将同一个表连接到多个字段
我有这个 SQL,我正在尝试将人员登录名表加入到包含多个用户 ID 的任务表中,
SELECT Task.TaskID
,Project.Project
,Task.Task
,Task.Description
,Task.OwnerLoginID //shown as Login.UserName
,Task.SubmitterID //shown as Login.UserName
,Task.IsVisible
FROM Task
INNER JOIN Project ON Task.ProjectID = Project.ProjectID
/*
INNER JOIN Login ON Task.SubmitterID = Login.LoginID
INNER JOIN Login ON Task.OwnerLoginID = Login.LoginID
*/
WHERE IsVisible = 1
但在底部的注释行中出现错误,我哪里出错了?
I have this SQL and i am trying to join a table of people's login names to a table of tasks that contains several user ids
SELECT Task.TaskID
,Project.Project
,Task.Task
,Task.Description
,Task.OwnerLoginID //shown as Login.UserName
,Task.SubmitterID //shown as Login.UserName
,Task.IsVisible
FROM Task
INNER JOIN Project ON Task.ProjectID = Project.ProjectID
/*
INNER JOIN Login ON Task.SubmitterID = Login.LoginID
INNER JOIN Login ON Task.OwnerLoginID = Login.LoginID
*/
WHERE IsVisible = 1
i get an error in the commented out lines at the bottom where am i going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试为表分配别名,例如
try assigning alias names to the tables e.g.
如果你想 JOIN 同一张桌子意味着,像这样给予
If you want to JOIN the same table means, Give like this