Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT '2000-01-01 00:00:00', 223
- FROM timeslots
- LEFT JOIN timeslotUsers ON timeslots.start = timeslotUsers.start
- WHERE timeslots.start = '2000-01-01 00:00:00'
- HAVING count(user_id) < timeslots.capacity
- SELECT '2000-01-01 00:00:00', 223, timeslots.capacity
- INSERT INTO timslotUsers (start, user_id)
- SELECT '2000-01-01 00:00:00', 223
- FROM timeslots
- LEFT JOIN timeslotUsers ON timeslots.start = timeslotUsers.start
- WHERE timeslots.start = '2000-01-01 00:00:00'
- HAVING count(user_id) < timeslots.capacity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement