作者jami520 (我的生命因你而发光)
看板Database
标题[SQL ] Invalid use of group function
时间Sat Feb 23 22:54:30 2013
请问这样写有错吗?
SELECT sid, bid, SUM(num) FROM mydbtable WHERE gdate>=
'2013-02-18' and gdate<= '2013-02-22' and SUM(num)/SUM(num/percentage)>0.05
GROUP BY concat(binary bid)
附注:sid, bid, num, percentage为table栏位
产生的错误为Invalid use of group function
找了很久,不晓得是哪边错误呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.71.217.130
1F:推 icydream:select的栏位,与group by的栏位不符 02/24 17:41
2F:→ icydream:改为select concat(binary bid), sum(num)试试, 02/24 17:42
3F:→ icydream:或是再重新调整group by的栏位。 02/24 17:43