mysql 汇总
子查询:
select
select
a.id,a.hotelname,max(b.day) as day,a.hotelrankid,
c.hotelrank,min(b.basicprice) as minprofit,
min(b.price) as minprice,d.suppliername
from
sline_hotel as a
left join
(
select * from sline_hotel_room_price
) as b on a.id=b.hotelid
LEFT JOIN
(
select
*
from
sline_hotel_rank
) as c on c.id = a.hotelrankid
LEFT JOIN
(
select
*
from
sline_supplier
) as d on d.id = a.supplierlist
where a.id=$id group by a.id
Try