insert into celltable values ('1001','A1','A2','A3','','','A6','A7','A8','A9') insert into celltable values ('1002','','','A1','A2','A3','A4','A5','A6','A7') insert into celltable values ('1003','A1','A5','A2','A4','A3','A6','A7','A8','A9')
select * from ( select pname,p1 P from celltable union all select pname,p2 P from celltable union all select pname,p3 P from celltable union all select pname,p4 P from celltable union all select pname,p5 P from celltable union all select pname,p6 P from celltable union all select pname,p7 P from celltable union all select pname,p8 P from celltable union all select pname,p9 P from celltable ) where p is not null order by pname,p
------解决方案-------------------- union all最基本的用法啊 ------解决方案--------------------
select * from (select pname, p1 P, 1 seq from celltable union all select pname, p2 P, 2 seq from celltable union all select pname, p3 P, 3 seq from celltable union all select pname, p4 P, 4 seq from celltable union all