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