Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 删除第一个X行入口ANSI_Sql_Dml_Ingres_Ansi 92 - Fatal编程技术网

Sql 删除第一个X行入口ANSI

Sql 删除第一个X行入口ANSI,sql,dml,ingres,ansi-92,Sql,Dml,Ingres,Ansi 92,我有730000多条记录需要在使用ANSI92的Ingres db中删除,然后我需要在不重载db的情况下删除,在搜索条件不起作用的情况下简单删除,db只使用所有内存和trowing错误。考虑在循环中运行它,并按10-20K部分删除记录 我试着用top,但没用 delete top (10)from TABLE where web_id <0 ; 从web_id所在的表中删除顶部(10个)您可以使用会话临时表来保存前10个TID(元组id),然后根据以下内容删除: declare glo

我有730000多条记录需要在使用ANSI92的Ingres db中删除,然后我需要在不重载db的情况下删除,在搜索条件不起作用的情况下简单删除,db只使用所有内存和trowing错误。考虑在循环中运行它,并按10-20K部分删除记录

我试着用top,但没用

 delete top (10)from TABLE where web_id <0 ;

从web_id所在的表中删除顶部(10个)您可以使用会话临时表来保存前10个TID(元组id),然后根据以下内容删除:

declare global temporary table session.tenrows as
select first 10 tid the_tid from "table" where web_id<0
on commit preserve rows with norecovery;

delete from "table" where tid in (select the_tid from session.tenrows);
将全局临时表session.tenrows声明为

从web ID所在的“表格”中选择前10个tid。谢谢,这非常有用!thnx!
declare global temporary table session.tenrows as
select first 10 tid the_tid from "table" where web_id<0
on commit preserve rows with norecovery;

delete from "table" where tid in (select the_tid from session.tenrows);
set session with on_logfull=notify;
delete from table where web_id<0;