Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. SELECT '2000-01-01 00:00:00', 223
  2. FROM timeslots
  3. LEFT JOIN timeslotUsers ON timeslots.start = timeslotUsers.start
  4. WHERE timeslots.start = '2000-01-01 00:00:00'
  5. HAVING count(user_id) < timeslots.capacity
  6.  
  7. SELECT '2000-01-01 00:00:00', 223, timeslots.capacity
  8.  
  9. INSERT INTO timslotUsers (start, user_id)
  10. SELECT '2000-01-01 00:00:00', 223
  11. FROM timeslots
  12. LEFT JOIN timeslotUsers ON timeslots.start = timeslotUsers.start
  13. WHERE timeslots.start = '2000-01-01 00:00:00'
  14. HAVING count(user_id) < timeslots.capacity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement