有如下表:pos code
1 a
1 b
1 c
2 e
2 f
3 g
3 h要得到如下结果,类似与迪卡尔积。a e g
b e g
c e g
a f g
b f g
c f g
......就是要把三个POS下的值以迪卡尔积方式列出,大家帮忙,谢谢啦。
1 a
1 b
1 c
2 e
2 f
3 g
3 h要得到如下结果,类似与迪卡尔积。a e g
b e g
c e g
a f g
b f g
c f g
......就是要把三个POS下的值以迪卡尔积方式列出,大家帮忙,谢谢啦。
(select * from tbl where pos=1) a,
(select * from tbl where pos=2) b,
(select * from tbl where pos=3) c
select a.code, b.code, c.code from
(select * from tbl where pos=1) a,
(select * from tbl where pos=2) b,
(select * from tbl where pos=3) c
GOOD !!!!!!!!!!!1
建议楼主给分.