mysql sql语句在where子句中不正确

时间:2011-05-26 02:55:34

标签: mysql

如何修复mysql的代码可能在m> 10

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

1 个答案:

答案 0 :(得分: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