摘要:
生成sql代码 生成静态:select *from (select sname,[Course ] ='数学',[Score]=[数学] from Tb_students union allselect sname,[Course]='英语',[Score]=[英语] from Tb_students union allselect sname,[Course]='语文',[Score]=[语文] from Tb_students)torder by sname,case [Course] when '语文' then 1 whe 阅读全文
摘要:
一张表查询结果为--行转列select years,(select amount from Tb_Amount as A where month=1 and A.years=Tb_Amount.years)as m1,(select amount from Tb_Amount as A where month=2 and A.years=Tb_Amount.years)as m2,(select amount from Tb_Amount as A where month=3 and A.years=Tb_Amount.years)as m3from Tb_Amount group by .. 阅读全文