2011-05-26 57 views
0

哪能也許修復代碼爲MySQL是錯誤的,在m> 10mysql的sql語句不正確,在where子句

SELECT 
    q_mem_tim.Hno, 
    q_mem_tim.Moo, 
    q_mem_tim.tambol, 
    count(*) as m 
FROM 
    q_mem_tim 
WHERE 
    m > 10 
GROUP BY 
    q_mem_tim.Hno, 
    q_mem_tim.Moo, 
    q_mem_tim.tambol 
order by m desc 
+0

什麼是表結構?我真的不明白你想在這裏做什麼... – Claudiu 2011-05-26 02:59:41

回答

3

嘗試

SELECT 
    q_mem_tim.Hno, 
    q_mem_tim.Moo, 
    q_mem_tim.tambol, count(*) as m 
FROM 
    q_mem_tim 
GROUP BY 
    q_mem_tim.Hno, 
    q_mem_tim.Moo, 
    q_mem_tim.tambol 
HAVING 
    count(*) > 10 
order by m desc