Subject Re: [firebird-support] delete and skip
Author Alexandre Benson Smith
Dalton Calford wrote:
> Is it possible to use skip in delete statements?
>
> for example
>
> delete from foo where foobar='mystuff' skip 1
>
> to delete duplicate records, leaving only one remaining....
>
> I was looking but could not find if firebird 1.53 supported it or not.
>
> thanks in advance
>
> Dalton
>
>

In FB 1.5 not ! It will delete every row

In FB 2.0 it works ok.

If all the fields has the same value on FB < 2.0 you could rely on
RDB$DB_KEY

there is some examples how to use it on this list, you could also look
at these articles
http://www.cvalde.net/document/practical_use_of_the_rdb.htm
http://www.cvalde.net/document/mysteriousDbKeyI.htm
http://www.cvalde.net/document/mysteriousDbKeyII.htm
http://www.cvalde.net/document/mysteriousDbKeyIII.htm
http://www.cvalde.net/document/mysteriousDbKeyIV.htm

or add a dummy column update it with a generator so each record will
have a unique identifier.
do the clean up and drop that dummy column.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br