antonyx
Arsenal Supporter
- Local time
- Today, 19:22
- Joined
- Jan 7, 2005
- Messages
- 556
my database is set up like this:
2 TABLES
table 1 - passenger table
passengerID - PK
passengerNAME
table 2 - bookings table
bookingID - PK
passengerID - FK
i want a list of passenger ids from the bookings table ordered by the most no. of occurences in the bookings table. i would also only want each id to be displayed once in the list..
eg.. if passenger id 35 appears 500 times, passenger 21 appears 20 times, and passenger 87 appears 2,500 times the list should read..
87
35
21
what criteria can i put in my query to acheive this?
2 TABLES
table 1 - passenger table
passengerID - PK
passengerNAME
table 2 - bookings table
bookingID - PK
passengerID - FK
i want a list of passenger ids from the bookings table ordered by the most no. of occurences in the bookings table. i would also only want each id to be displayed once in the list..
eg.. if passenger id 35 appears 500 times, passenger 21 appears 20 times, and passenger 87 appears 2,500 times the list should read..
87
35
21
what criteria can i put in my query to acheive this?