sql server中in和exists的小区别 oracle未测试
in 的话, 如果是null 就不比较了,既不是in 也不是 not in
exists的话 因为用 = 加在条件里比较了,所以 null 是 not exists
select *
from pricetemp
where cast(商品コード as varchar(10))not in(
select shohin_cd
from m_price)
select *
from pricetemp
where not exists (select shohin_cd
from m_price
where cast(pricetemp.商品コード as varchar(10))=m_price.shohin_cd)
以上2条会有不同的结果,因为 pricetemp.商品コード 有很多 null
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
oracle 方法 & ......
普通MySQL运行,数据量和访问量不大的话,是足够快的,但是当数据量和访问量剧增的时候,那么就会明显发现MySQL很慢,甚至down掉,那么就要考虑优化我们的MySQL了。
优化无非是从三个角度入手:
第一个是从硬件,增加硬件,增加服务器
第二个就是对我们的MySQL服务器进行优化,增加缓存大小,开多端口,读写分开
第三个 ......
以前一直觉得linq to sql生成类似where id not in (1,3,5)或where id not in (select id from ...)这样的条件不是很方便,每次我都是把条件ID事先取到一个数组里,然后用 !Arr.Contains(c.Id)这样处理,今天突然发现这样好傻,其实可以完全直接用linq写成一句,贴个示例在这里,以后备查
from a in TableA where !(fr ......