Select a.id,a.hotelmain_name,a.hotel_star,Min(b.hotel_room) as hotel_room,b.hotel_price,min(b.hotel_member_price) as hotel_member_price,b.hotel_weekend_price From hotelmain a , hotelminor b Where a.id=b.hotelmain_id Group by a.id,a.hotelmain_name,a.hotel_star,b.hotel_price,b.hotel_weekend_price
select a.id,a.hotelmain_name,a.hotel_star,b.hotel_room,b.hotel_price,b.hotel_member_price as hotel_member_price,b.hotel_weekend_price from hotelmain a,(select hotelmain_id,hotel_room,hotel_price,hotel_member_price,b.hotel_weekend_price from hotelminor 别名 where hotelminor表的主键=(select top 1 hotelminor表的主键 from hotelminor where hotelmain_id=别名.hotelmain_id order by hotel_member_price)) b Where a.id=b.hotelmain_id
SELECT * FROM hotelmain INNER JOIN (SELECT MIN(hotel_price) AS cc,hotelmain_name AS t1 FROM hotelmain GROUP BY hotelmain_name) DERIVEDTBL ON otelmain.hotelmain_name = DERIVEDTBL.t1 AND otelmain.hotel_price = DERIVEDTBL.cc
as hotel_member_price,b.hotel_weekend_price
From hotelmain a , hotelminor b Where a.id=b.hotelmain_id
Group by a.id,a.hotelmain_name,a.hotel_star,b.hotel_price,b.hotel_weekend_price
FROM hotelmain INNER JOIN
(SELECT MIN(hotel_price) AS cc,hotelmain_name AS t1
FROM hotelmain
GROUP BY hotelmain_name) DERIVEDTBL ON otelmain.hotelmain_name = DERIVEDTBL.t1 AND
otelmain.hotel_price = DERIVEDTBL.cc