Guest User

Untitled

a guest
May 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. SELECT u.*,
  2. r.autocompletion,
  3. (SELECT COUNT(DISTINCT a.user_id)
  4. FROM emissions e
  5. INNER JOIN abonnements a
  6. ON a.emission_id = e.id
  7. WHERE e.main_rea = u.id
  8. OR Find_in_set(u.id, e.others_rea) > 0) AS abonn
  9. FROM users u
  10. LEFT JOIN realisateurs r
  11. ON r.user_id = u.id
  12. WHERE u.user_type = "realisateur"
Add Comment
Please, Sign In to add comment