举例:
===========================
字段
1
2
3
4
5
6我想去掉1、5,只显示2、3、4、6请问该如何做?

解决方案 »

  1.   

    没有规律?
    那就
    select * from table where 字段 <>('1','5')
      

  2.   

    如果这张表是从另一个多表查询得到的表的结果,应该如何写呢?比如:select * from table1 union select * from table2然后再从以上这个结果中去掉指定行,语法该如何写?
      

  3.   

    select * from table where 字段 not in ('1','5')
      

  4.   

    --可以这样写
    select * from table1 
    where ...
    union 
    select * from table2
    where ...就是在检索的时候把不符合条件的纪录删掉
    --还可以这样写:
    select * from 
    (
    select * from table1 
    union 
    select * from table2
    )a
    where