Use this SQL statement please:
select time,(case name when 'P1' then data else null end) as P1,(case name when 'P2' then data else null) as P2,(case name when 'P3' then data else null) as P3 into tableB from tableA group by time
select time,(case name when 'P1' then data else null end) as P1,(case name when 'P2' then data else null) as P2,(case name when 'P3' then data else null) as P3 into tableB from tableA group by time
解决方案 »
- 求SQL语句: 如何这样增加列?
- 批量插入的还是没弄明白
- 帮我看看这个吧.http://community.csdn.net/Expert/topic/5004/5004841.xml?temp=.4836389,谁能把触发器在update时的结果计算出来啊.
- 如何创建索引序号?
- Java 实现 sqlserver 数据库还原问题
- 帮忙看下AC转SQL 后出现的问题
- sql行转列
- 又有53分了,可以拿出30分问问这个有关记录分组编记录号的问题了.
- sqlserver 2005 sqlserver 进程占CPU的100%怎么解决?
- 网站数据库sql server2000记录不断被删,像并非sql注入的问题,大家帮帮忙啊,一个早上册了五百多条,每天都在减少
- 如何在Oracle中写一个可以存入Long raw的存储过程?
- oracle 的网络监听问题
select time,(case name when 'P1' then data else null end) as P1,(case name when 'P2' then data else null end) as P2,(case name when 'P3' then data else null end) as P3 into tableB from tableA group by time