[SQL ] Invalid use of group function

看板Database作者 (我的生命因你而發光)時間13年前 (2013/02/23 22:54), 編輯推噓1(102)
留言3則, 1人參與, 最新討論串1/1
請問這樣寫有錯嗎? 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

02/24 17:41, , 1F
select的欄位,與group by的欄位不符
02/24 17:41, 1F

02/24 17:42, , 2F
改為select concat(binary bid), sum(num)試試,
02/24 17:42, 2F

02/24 17:43, , 3F
或是再重新調整group by的欄位。
02/24 17:43, 3F
文章代碼(AID): #1HADWfwW (Database)