Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. id_archivo id_p
  2. 1 1
  3. 1 2
  4. 2 2
  5. 2 3
  6. 1 3
  7. 3 2
  8. 3 4
  9. 4 1
  10. 4 2
  11. 4 3
  12.  
  13. select id_archivo, count(id_p) as p from archivoscompartidos where id_p=2 and id_archivo in (select id_archivo from archivoscompartidos where id_p=3) group by id_archivo having count(id_p)<3;
  14.  
  15. id_archivo p
  16. 1 1
  17. 2 1
  18. 4 1
  19.  
  20. select id_archivo, count(id_p) as p from archivoscompartidos where id_p=2 and
  21. id_archivo in (select id_archivo from archivoscompartidos where
  22. id_p=3)
  23. group by id_p having count(id_p);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement