Guest User

Untitled

a guest
Mar 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. SELECT p_count, count(p_count) AS count_id FROM
  2. (SELECT bookings.bookings.book_ref, count(bookings.tickets.passenger_name) as p_count FROM
  3. bookings.bookings INNER JOIN bookings.tickets ON bookings.bookings.book_ref=bookings.tickets.book_ref
  4. GROUP BY bookings.bookings.book_ref
  5. ORDER BY p_count desc) z
  6. GROUP BY p_count
  7. ORDER BY count_id desc
  8. LIMIT 1
Add Comment
Please, Sign In to add comment