不要select * 
直接select id,name,age (你想要的行) from table where... 

解决方案 »

  1.   

    比如:select * from table where name = 'a' and age ='b' and address ='c'
          union 
          select * from table where name = 'q' and age ='w' and address ='e'
          union 
          select * from table where name = 'j' and age ='k' and address ='l'
      

  2.   

    select*   from   TABLE   where   userid   not   in(select   *   from   TABLE)
      

  3.   


    SELECT * FROM table WHERE not EXISTS 
    (SELECT * FROM  
    (select * from table where name = 'a' and age ='b' and address ='c'
          union 
          select * from table where name = 'q' and age ='w' and address ='e'
          union 
          select * from table where name = 'j' and age ='k' and address ='l' ) t
    WHERE table.name=t.name and table.age=t.age and table.address=t.address)
      

  4.   


    select * from 表 where not exists (select 1 from 表 where '唯一主见'='不想显示')
      

  5.   

    begin
    select *,Identity(int,1,1) as Id into #temp from table
    select * from #temp a,(
    select * from #temp  where name = 'a' and age ='b' and address ='c'
          union 
          select * from #temp  where name = 'q' and age ='w' and address ='e'
          union 
          select * from #temp  where name = 'j' and age ='k' and address ='l') b
    where a.Id<>b.Id
    end
      

  6.   

    看了下,既然知道所有行,那不想要一些行,用not exists不可以满足要求了么?