SQL 查询语句:统计玩家物品数量并筛选
SELECT PlayerId,itemcfg.ItemType,SUM(Count) as item_SUM FROM item LEFT JOIN itemcfg ON itemcfg.Id = item.ItemCfgId WHERE 1=1 GROUP BY PlayerId,ItemType HAVING CASE itemcfg.ItemType WHEN 0 THEN item_SUM >= 50 ELSE NONE END CASE; ORDER BY item_SUM DESC
原文地址: https://www.cveoy.top/t/topic/qdqy 著作权归作者所有。请勿转载和采集!