如果这张表是从另一个多表查询得到的表的结果,应该如何写呢?比如:select * from table1 union select * from table2然后再从以上这个结果中去掉指定行,语法该如何写?
select * from table where 字段 not in ('1','5')
--可以这样写 select * from table1 where ... union select * from table2 where ...就是在检索的时候把不符合条件的纪录删掉 --还可以这样写: select * from ( select * from table1 union select * from table2 )a where
那就
select * from table where 字段 <>('1','5')
select * from table1
where ...
union
select * from table2
where ...就是在检索的时候把不符合条件的纪录删掉
--还可以这样写:
select * from
(
select * from table1
union
select * from table2
)a
where