您好我有以下查询:
SELECT pr.*, img.image_file, c.contract_id, c.cmin_markup, c.cmeal_plan, c.tax_include, c.civa, m.plan_name, r.room_name, r.room_id FROM contracts AS c
INNER JOIN meal_plan AS m ON m.plan_code = c.cmeal_plan AND m.lang = '1'
INNER JOIN room_infos AS r ON r.hotel_id = '$hid' AND r.lang = '1'
LEFT JOIN images AS img ON img.foreign_id = r.room_id LIMIT 1
LEFT JOIN promotions as pr ON pr.hotel_id = '$hid' AND FIND_IN_SET('c.contract_id', pr.contract_id) > 0 AND FIND_IN_SET('r.room_id', pr.room_id) > 0 AND pr.travel_start <= '$now' AND pr.travel_end >= '$now' AND pr.book_start <= '$arriving' AND pr.book_end >= '$departing' AND pr.lang='1'
WHERE c.hotel_id = '$hid' AND c.cstart <= '$arriving' AND c.cend >= '$departing' AND c.ctype = '1'"
我需要限制图像表只给我一个结果。我不确定这是否可行,或者如何实现这一目标的最佳方式。如果需要更多信息,请告诉我。要发布的表格很多。提前感谢您的帮助!!