Subject Re: [maybe OT] where [not] singular
Author duilio_fos
I just learnt (from Arno Brinkman) that the following instruction

> DELETE FROM
> TableA t1
> WHERE
> NOT SINGULAR(SELECT * FROM TableA t2 WHERE t2.DUB_KEYS =
t1.DUB_KEYS)

will delete all the rows in TableA that have the same value in column
dub_keys EXCEPT ONE.

I find this instruction unbelievely useful when I want to get rid of
unwanted duplicates and (of all duplicates) have just one left.

However I am puzzled by the logic behind the SINGULAR keyword.

It seems foreign to the usual union/intersection logic found in SQL.

Was the keyword created (in IB alone ?) in reason of its usefulness ?

Thank you

Duilio Foschi