数据库内连接出错:无法绑定由多个部分组成的标识符
SELECTdbo.tb_forum.id,dbo.tb_forum.title,dbo.tb_forum_style.forumstyle,dbo.tb_sub_for...
SELECT dbo.tb_forum.id, dbo.tb_forum.title, dbo.tb_forum_style.forumstyle, dbo.tb_sub_forum.contents,
dbo.tb_forum_user.users, dbo.tb_sub_forum.first_forum, dbo.tb_forum.hf_nums, dbo.tb_forum.dates,
dbo.tb_forum_user.users_nc
FROM dbo.tb_forum INNER JOIN
dbo.tb_forum_style INNER JOIN
dbo.tb_forum_user INNER JOIN
dbo.tb_sub_forum ON dbo.tb_sub_forum.forumid = dbo.tb_forum.id ON
dbo.tb_forum_style.id = dbo.tb_sub_forum.styleid ON dbo.tb_forum.id = dbo.tb_sub_forum.forumid
WHERE (dbo.tb_sub_forum.first_forum = 1)
T错误提示是:无法绑定由多个部分组成的标识符”dbo.tb_forum.id“ 展开
dbo.tb_forum_user.users, dbo.tb_sub_forum.first_forum, dbo.tb_forum.hf_nums, dbo.tb_forum.dates,
dbo.tb_forum_user.users_nc
FROM dbo.tb_forum INNER JOIN
dbo.tb_forum_style INNER JOIN
dbo.tb_forum_user INNER JOIN
dbo.tb_sub_forum ON dbo.tb_sub_forum.forumid = dbo.tb_forum.id ON
dbo.tb_forum_style.id = dbo.tb_sub_forum.styleid ON dbo.tb_forum.id = dbo.tb_sub_forum.forumid
WHERE (dbo.tb_sub_forum.first_forum = 1)
T错误提示是:无法绑定由多个部分组成的标识符”dbo.tb_forum.id“ 展开
2个回答
展开全部
你就没写 dbo.tb_forum这个表啊
追问
第一个ON那就是呀
追答
那应该没问题了,是不是你还有其他的语句没贴出来啊?
还有,多表联合查询的时候,最好写个简单的别名,不要把表全名都写上
这样不方便维护,就像你这样,找个列名表名的都费劲
一般可简写dbo.tb_forum f INNER JOIN dbo.tb_forum_style fs on f.id=fs.forumid.id
只是个例子
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询