我有一个MySQL内部联接查询,我试图使用as
关键字进行简化。
原始查询:
SELECT u.user
, g.group
, b.type
, b.name
, b.count
, b.date
FROM profile.user u
JOIN profile.group g
ON g.GroupID = u.GroupID
JOIN main.set b
ON b.ID = u.GroupID
GROUP
BY u.username
, u.GroupID
简化查询:
# Returns user and ID
select profile.user as user,
profile.group as group,
main.set as b
from user,
inner join group on group.ID = user.ID
inner join b on b.ID = user.ID
group by user.name
错误:#1064 - 您的SQL语法出错;查看与MySQL服务器版本对应的手册,以获得正确的语法。
答案 0 :(得分:1)
{{1}}