select a from tbl 
union 
select b from tbl
union 
select c from tbl
union 
select d from tbl
union 
select e from tbl

解决方案 »

  1.   

    可能我阐述问题的时候给大家造成了误解,我上面说的数据组是数据库里面的,而不是我抓出来了这样的数据组,最后我通过 下面解决,但是不知道效率如何
    select DISTINCT a as bb
    union
    select DISTINCT b as bb
    union
    select DISTINCT c as bb
    union
    select DISTINCT d as bb
    union
    select DISTINCT e as bb
    union
    ..
    ..
    ..等等最后得到 bb的结果集谢谢大家
      

  2.   

    我试了试你的语句,UNION似乎可以自动去重,DISTINCT关键字并不需要。