[英]How can I pivot result of SQL query
您可以使用(虛假的)聚合函數並按分組
select type_revenue
, max(case when location_name ='30juin' then amount else 0 end) 30Jui
, max(case when location_name ='Bandal' then amount else 0 end) Bandal
from my_tbale
group by type_revenue
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.