- mysql: two tables but three select criteria
- SELECT id FROM users, user_depts
- WHERE users.id = user_depts.uid
- AND user_depts.uid = 7
- SELECT uid FROM user_depts
- WHERE EXISTS (
- SELECT * FROM user_depts a
- WHERE uid = 7 AND a.did = user_depts.did
- )
- select users.id from users
- inner join user_depts.uid = users.id
- where users.id = 7