0
下面的查詢工作MySql上5,但我的客戶擁有的MySQL 4.1.15和此查詢,出現以下錯誤扼流圈:我怎樣才能得到這個MySQL查詢在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的版本是不是BTW的選項。有人可以幫我重寫這個版本來處理舊版本的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")
謝謝指點先生! – SirM 2012-04-16 18:47:15