select * from table1 
where (select count(*) from table1) = (select count(*) from table1 where a3 = 1)

解决方案 »

  1.   

    select * from 
    table1,(select count(*) as idd from table1 where a3='1') a,(select count(*) as idd from table1) b 
    where a.idd=b.idd
      

  2.   

    select * from table1 where not exists(select 1 from table1 where a3<>'1')
      

  3.   

    Select * from table1 where not exists(select * from table1 where a3 <> '1')
      

  4.   

    select * from table1 where not exists(select 1 from table1 where a3<>'1')
      

  5.   

    select * from table1 where  exists(select 1 from table1 where a3='1')
      

  6.   

    select * from table1 where  exists(select 1 from table1 where a3='1')
      

  7.   

    同意tj_dns(愉快的登山者) 
    select * from table1 
    where (select count(*) from table1) = (select count(*) from table1 where a3 = 1)
      

  8.   

    : tj_dns(愉快的登山者) 
     hjb111(唐老鸭) 
     maoxianqiang(sky)
    myflok(阿棋) 
     txlicenhe(马可@李) (正确。。
    向你们学习,有更好的SQL的请上帖,继续给分
      

  9.   

    select * from table1 where not exists(select 1 from table1 where a3<>'1')
      

  10.   

    select * from table1 where not exists(select 1 from table1 where a3<>'1')