UPDATE TABLE SET SOMETHING = 1 WHERE ID IN (SELECT ID FROM STORED_PROCEDURE)
TABLE = 2100
存储过程记录= 50
这个语句在firebird 2.5服务器上产生了大量的读取(31M!)为什么?它不应该首先从存储过程中选择id,然后把它放在where子句中吗?我该怎么做才能成功呢?
试试这样:
declare variable myid integer;
begin
for
select id from stored_procedure into :myID
do begin
update table set something = 1 where table.id = :myID;
end
end