我的客户MySql 5有以下的问询,但我的客户MySql 4.1.15有这样的错误:
#1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
提升客户MySql版本并不是一种选择W。 难道有人会帮助我重新做这项工作,以了解MySql的旧版本?
SELECT
Sum( room_rev + room_rev_future ) as weekly_room_rev,
Sum( (`food_rev`) + (`beverage_rev`)) as weekly_catering_rev,
(SELECT min_sales_persons
FROM bdp_hotel_min WHERE
bdp_hotel_min.hotel_num = bdp_scorecard.hotel_num
AND UNIX_TIMESTAMP(bdp_hotel_min.`min_override_week`)
< UNIX_TIMESTAMP("2011-12-02 23:59:59")
ORDER BY bdp_hotel_min.`min_override_week` DESC LIMIT 1 ) as override_persons,
min_sales_persons
FROM bdp_scorecard JOIN locations ON bdp_scorecard.hotel_num = locations.hotel_num
WHERE bdp_scorecard.hotel_num =837 AND bdp_scorecard.hotel_num = 837
AND UNIX_TIMESTAMP(bdp_scorecard.`created_date`) >= UNIX_TIMESTAMP("2011-11-26")
AND UNIX_TIMESTAMP(bdp_scorecard.`created_date`) < UNIX_TIMESTAMP("2011-12-02 23:59:59")