Skip to content

Instantly share code, notes, and snippets.

@baileywickham
Last active August 21, 2020 20:28
Show Gist options
  • Save baileywickham/43ba25a76e72d746611f7f75dac43f8b to your computer and use it in GitHub Desktop.
Save baileywickham/43ba25a76e72d746611f7f75dac43f8b to your computer and use it in GitHub Desktop.
select dayofweek(checkin), count(code), sum(datediff(checkout, checkin)*rate)
from reservations
join rooms on rooms.roomcode=reservations.room
group by dayofweek(checkin)
order by dayofweek(checkin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment