select firstno from 表 where secondno='02'

解决方案 »

  1.   

    请看仔细哦:)
    02-1是bno~~~~~
      

  2.   

    select bno from 表 where firstno ='02'
    union all
    select firstno from 表 where secondno ='02'
      

  3.   

    select aaa from (select bno aaa from 表 where firstno ='02'
    union all
    select firstno aaa from 表 where secondno ='02') tem group by aaa
      

  4.   

    或:
    select distinct bno from 表 where firstno ='02'
    union all
    select distinct firstno from 表 where secondno ='02'
      

  5.   

    ok:
    select bno from tablename where firstno = '02'
    union all
    select firstno from tablename where secondno = '02'