select uname,sum(points) from tb group by uname having sum(points) > 6
SELECT uname,sum( points) as total FROM `tab_name` WHERE tatol >6 group by uname ;
select uname from table1 group by uname having sum(points) >= 6
SELECT uname,sum( points) as total FROM `tab_name` WHERE tatol >6 group by uname ; 这个执行报错啊Unknown column 'tatol' in 'where clause' select uname from table1 group by uname having sum(points) >= 6 这个执行的话后面还能跟条件吗 比如 tag=0
select uname from table1 where tag=0 group by uname having sum(points) >= 6
group by uname
having sum(points) > 6
from table1
group by uname
having sum(points) >= 6
这个执行报错啊Unknown column 'tatol' in 'where clause' select uname
from table1
group by uname
having sum(points) >= 6
这个执行的话后面还能跟条件吗 比如 tag=0
from table1
where tag=0
group by uname
having sum(points) >= 6
我试了一下,结果只是给出了points>6 的用户,并没有给出和大于6的用户。请问你得出的结果是正确的吗