SQL server 行转列

2017-11-22 14:16:49来源:oschina作者:Lucky_Me人点击

分享

select * from (select b.site_name as name,a.site_code as code,monitor_factor_code as monitor_factor_code,revised_monitor_value as monitor_value from t_dusty_monitor_factor_rtdata_inquire a left join t_dusty_basicinfo b on a.site_code = b.site_code where monitor_factor_code in ('985','986','984'))tb pivot (max(monitor_value) formonitor_factor_code in ([985],[986],[984]) ) b


最新文章

123

最新摄影

闪念基因

微信扫一扫

第七城市微信公众平台