请告诉我这个sql有什么问题?
SELECT users_map.user_id
FROM users_map
WHERE users_map.service_id = 1
AND users_map.service_user_id = 0
RIGHT OUTER JOIN user_data
ON users_map.user_id = user_data.user_id
答案 0 :(得分:2)
WHERE
子句应放在查询的末尾:
SELECT users_map.user_id
FROM users_map
RIGHT OUTER JOIN user_data
ON users_map.user_id = user_data.user_id
WHERE users_map.service_id = 1 AND
users_map.service_user_id = 0