使用重复名称从该文件中

到具有唯一名称但某些字段跨多列转置的单个文件。

发布于 2018-08-02 20:37:30
你需要条件聚集:
select name,
sum(iif(transactiotype = 'Purchase', OrderAmt, 0)) as Purchase,
sum(iif(transactiotype = 'Purchase fees', OrderAmt, 0)) as Purchasefees
from table t
group by name;https://stackoverflow.com/questions/51653765
复制相似问题