Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Queries

By: a guest on Oct 2nd, 2013  |  syntax: MySQL  |  size: 0.83 KB  |  views: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #FIRST QUERY
  2.  
  3. SELECT event.* ,
  4. count( user_registration.user_registration_id ) AS user_registration_count
  5.  
  6. FROM `event`
  7.  
  8. LEFT JOIN registration_item ON
  9. registration_item.event_id = event.event_id
  10.  
  11. LEFT JOIN user_registration ON
  12. user_registration.registration_item_id = registration_item.registration_item_id
  13.  
  14. WHERE 1 = 1 AND event.event_id = '5240e695-9acc-4e32-9b98-1aecb3d0838' GROUP BY event.event_id;
  15.  
  16. #SECOND QUERY
  17.  
  18. SELECT event.* ,
  19. count( user_registration.user_registration_id ) AS user_registration_count
  20.  
  21. FROM `event`
  22.  
  23. LEFT JOIN registration_item ON
  24. registration_item.event_id = event.event_id
  25.  
  26. LEFT JOIN user_registration ON
  27. user_registration.registration_item_id = registration_item.registration_item_id
  28.  
  29. WHERE 1 = 1 AND event.event_id = '5240e695-9acc-4e32-9b98-1aecb3d0838' GROUP BY event.event_id LIMIT 50;