Kerry wrote:
> I don't understand why the sub-query would need to be executed once for
> every row in 'A'.
>
> Surely a half-decent optimizer should cope with that statement
> sensibly?
Perhaps, but it didn't appear to be very optimized on the 1000-
odd record test I did.
> Informix lets you use temporary tables instead, but Interbase doesn't
> *have* temporary tables.
Ya, I thought so. Never needed them, neither. Kuet-Fung
suggested this solution -- I haven't tried it yet:
delete A
where not Exists(select B.ID from B where B.A_ID=A.ID)
> Isn't the SQL "standard" just a delight?
Quite. <g>
cheers,
peter
============================================
Peter Hyde, SPIS Ltd, Christchurch, New Zealand
* Print-to-Web automation http://TurboPress.com
* Web design, automation and hosting specialists
* TurboNote: http://TurboPress.com/tbnote.htm
-- small, FREE and very handy
Find all the above and MORE at http://www.spis.co.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz