标签:
使用group by 需要查询的字段 必须要放在group by 后面
SELECT U.UserLotterySn,count(W.Userlotterysn) as WinCount,U.ActivityCode,CertType,CertNumber,LotterySumCount,LotteryCounted,IsBigWin,U.CreateBy,U.CreateDate
FROM T_UserLottery U
JOIN T_WinningUser W on W.UserLotterySn = U.UserLotterySn WHERE 1 = 1 group by u.Userlotterysn,WinCount,U.ActivityCode,CertType,CertNumber,LotterySumCount,LotteryCounted,IsBigWin,U.CreateBy,U.CreateDate
标签:
原文地址:http://www.cnblogs.com/bruceli-net/p/4804889.html