Subject Re: [firebird-support] How to delete the output of this "select first 100 seqno from repl_log where relationno =11 order by seqno"
Author Milan Babuskov
Mohd. Jeffry wrote:
> How to delete the output of this "select first 100 seqno from repl_log
> where relationno =11 order by seqno"

1. Not very efficient:

delete from repl_log r
where 101 > (
select count(*) from from
repl_log r2 where relationno = 11
and r2.seqno < r.seqno)

2. Use a stored procedure:

for
select first 100 seqno
from repl_log
where relationno = 11
order by seqno
into :seqno
do
delete from repl_log where seqno = :seqno;

--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org