Two hotels for the list
Posted: Mon Sep 08, 2008 9:20 am
There are many entries in the 'search' table
Table - 'search'
Table data - holiday details, hotel, price
In the list, I must only have two of the same hotel.
The other search criteria is that the list must be in price order.
If i do the following sql statement
select distinct hotel
from search
and then loop through the hotels and run the next sql statement
select *
from search
where hotel = (above hotelid)
limit 2
I will get 2 entries in the search table for each hotel
the problem is that the list might not be in price order
Does anybody know how to get around this?
Table - 'search'
Table data - holiday details, hotel, price
In the list, I must only have two of the same hotel.
The other search criteria is that the list must be in price order.
If i do the following sql statement
select distinct hotel
from search
and then loop through the hotels and run the next sql statement
select *
from search
where hotel = (above hotelid)
limit 2
I will get 2 entries in the search table for each hotel
the problem is that the list might not be in price order
Does anybody know how to get around this?