-
删除重复数据
delete from old_gamerole where id in (SELECT id from (select id,role from old_gamerole group by role having count(role) > 0) tmp1)
主要通过having count(role) > 0查询出重复的数据
-
查询数据的rowno
SELECT @rowno:=@rowno+1 as rowno,r.* from guaguale_canyu r,(select @rowno:=0) t where r.ggId=210 -
sum条件统计
select sum(if(type=1,point,0)) from user group by userId;