#第一步: 兩表合并,合并待處理的數(shù)據(jù) SELECT g.id, g.name, g.weight, t.count FROM goods g LEFT JOIN trans t ON g.id = t.goods_id #第二步:按照商品id匯總數(shù)量,注意distinct去重 SELECT DISTINCT id,NAME,weight, SUM(COUNT) over(PARTI...