一张表table字段F1和F2
F1 F2
1 a
2 b
3
达成的效果:
1 a
1 b
2 a
2 b
3 a
3 b
求这个sql文 应该怎样写?小弟初学,麻烦各位大侠指教。
------解决方案--------------------------------------------------------
SELECT a.f1,b.f2 from tt a,tt b
where b.f2 is not null
------解决方案--------------------------------------------------------
- SQL code
select a.f1,b.f2from table a,table border by a.f1,b.f2
------解决方案--------------------------------------------------------
SELECT a.f1,b.f2 from tt a,(select distinct f2 from tt) b
where b.f2 is not null
------解决方案--------------------------------------------------------