I want to create a sql query that lets me make a top 5 of the most used ids in my table.
My table has these columns:
reservationid
costumerid
roomid
hotelid
I’m trying to get a top 5 of the most used hotel ids.
I thought I had to use the count function but that doesn’t seem to work. It just counts all the hotelids and doesn’t see the difference between the id’s
select count(hotelid) from reservation;
Can someone help me push me in the right direction?
Thanks in advance!
1 Answer