select f1 ff1,f2 ff2 from t1 union all select f1 ff1,f3 ff2 from t1 union all select f1 ff1,f4 ff2 from t1
顶一楼 可以再排序下得到楼主要的结果 select * from( select f1 ff1,f2 ff2 from t1 union all select f1 ff1,f3 ff2 from t1 union all select f1 ff1,f4 ff2 from t1 )order by ff1
select f1 f11,f2 f22 from T1 union all select f1 f11,f3 f22 from T1 union all select f1 f11,f4 f22 from T1
INSERT ALL INTO t2 VALUES(f1, f2) INTO t2 VALUES(f1, f3) INTO t2 VALUES(f1, f4) SELECT * FROM t1;
union all
select f1 ff1,f3 ff2 from t1
union all
select f1 ff1,f4 ff2 from t1
可以再排序下得到楼主要的结果
select * from(
select f1 ff1,f2 ff2 from t1
union all
select f1 ff1,f3 ff2 from t1
union all
select f1 ff1,f4 ff2 from t1
)order by ff1
select f1 f11,f2 f22 from T1
union all
select f1 f11,f3 f22 from T1
union all
select f1 f11,f4 f22 from T1
INTO t2 VALUES(f1, f2)
INTO t2 VALUES(f1, f3)
INTO t2 VALUES(f1, f4)
SELECT * FROM t1;
不能用union
你想想该怎么写。如果想不出来
另开新帖,我发给你