去重原生SQL
//先去重00状态的数据
//分组获取不重复的数据进行统计
SELECT * ,count(*) num FROM scp_trade_tradeinfohl where state='00' GROUP BY TAC,txnTime,samId,txnAmt ORDER BY num DESC
//分组获取重复的数据
SELECT * ,count(*) num FROM scp_trade_tradeinfohl where state='00' GROUP BY TAC,txnTime,sam
原创
2021-02-07 09:04:02 ·
154 阅读 ·
0 评论