create table tb3(v1 int ,v2 int ,v3 int);
insert into tb3(v1,v2,v3) values(1,1,1);
insert into tb3(v1,v2,v3) values(1,2,1);
insert into tb3(v1,v2,v3) values(1,3,1);
insert into tb3(v1,v2,v3) values(2,1,1);
insert into tb3(v1,v2,v3) values(2,2,1);
insert into tb3(v1,v2,v3) values(2,3,1);
select * from tb3
select * from tb3 pivot(max(v3) for v2 in(1,2,3));