SELECT PlayerIditemcfgItemTypeSUMCount as item_SUM FROM itemLEFT JOIN itemcfg ON itemcfgId = itemItemCfgIdWHERE 1=1 GROUP BY PlayerIdItemType HAVING CASE itemcfgItemType WHEN 0 THEN item_SUM = 50 ELS
The given SQL query is not valid. The correct query is as follows:
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
WHEN itemcfg.ItemType = 0 THEN item_SUM >= 50
ELSE NULL
END
ORDER BY item_SUM DESC
原文地址: https://www.cveoy.top/t/topic/ivVA 著作权归作者所有。请勿转载和采集!