Reputation: 340
Please tell me what is wrong with that 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
Upvotes: 0
Views: 1826
Reputation: 72175
WHERE
clause should be placed at the end of your query:
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
Upvotes: 2