注册 登录
编程论坛 ACCESS论坛

求助:查询错误

cyyu_ryh 发布于 2008-02-04 17:12, 1681 次点击
select Users.UserID as UserID,Users.CustomerName,Users.CustomerAddress,Users.CustomerTelephone,Users.ZipCode,Flower.[ID],Shopping.[ID],Shopping.UserID as SuserID from Users left join  Shopping on Users.UserID=Shopping.UserID left join Flower on Shopping.[ID]=Flower.[ID]
我在ACCECE查询分析器里面始终是这个错误

语法错误 (操作符丢失) 在查询表达式 'Users.UserID=Shopping.UserID                            left join Flower on Shopping.[ID]=Flower.[ID]' 中。

但是在SQL2000中不报错
请问为什么?我需要用ACCECE语句
3 回复
#2
madpbpl2008-02-04 21:11
select Users.UserID as UserID,Users.CustomerName,Users.CustomerAddress,Users.CustomerTelephone,Users.ZipCode,Flower.[ID],Shopping.[ID],Shopping.UserID as SuserID from Users,Flower left join  Shopping on Users.UserID=Shopping.UserID where Shopping.[ID]=Flower.[ID]
改成这样试试,两个left join好象不能这样写的。
#3
cyyu_ryh2008-02-14 15:46
也不行啊
提示:
JOIN 操作语法错误。
#4
cyyu_ryh2008-02-14 16:07
可以了,在前加个括号就可以了
select Users.UserID as UserID,Users.CustomerName,Users.CustomerAddress,Users.CustomerTelephone,Users.ZipCode,Flower.[ID],Shopping.[ID],Shopping.UserID as SuserID from (Users left join  Shopping on Users.UserID=Shopping.UserID) left join Flower on Shopping.[ID]=Flower.[ID]
1