Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.36 KB | None | 0 0
  1. select id, name, count(*) usercount from
  2.  
  3. ((select project.id, project.name from project, user_project_priv where project.id= user_project_priv.project_id)
  4. union all
  5. (select id, name from project where id not in (select distinct project.id from user_project_priv, project where project.id=user_project_priv.project_id))) as fos
  6.  
  7.  group by id order by usercount
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement