项目中会有上十万数据批入库,但是担心存储问题,要剔除重复数据,这里就用到了ignore操作.
- 创建规则:
create rule [规则名称] as on insert to [表名] where exists (select 1 from [表名] where [判断条件]) do instead nothing;
- 建立索引.
create
rule [规则名称] as on insert to [表名]
where
exists
(select 1 from [表名] where [判断条件])
do instead nothing;