sql2008 sql语句实现交换行列答:--Create the table and insert values as portrayed in the previous example.CREATE TABLE pvt (VendorID int, Emp1 int, Emp2 int, Emp3 int, Emp4 int, Emp5 int);GOINSERT INTO pvt VALUES (1,4,3,5,4,4);INSERT INTO pvt VALUES (2,4,1,5,5,5);INSERT INTO pvt VALUES ...
SQL SERVER 2008 复杂行转列答:2000000,6)insert into test values ('JNHS1501','2015-07-29',684770,7)insert into test values ('JNHS1502','2015-05-05',180000,1)insert into test values ('JNHS1502','2015-01-05',50000,2)执行declare @sql varchar(4000)set @sql = 'select 合同编号'select @sql = @sql +...