Subject Re: [Firebird-Architect] SQL Update and Delete
Author Arno Brinkman
Hi,

> I would like to see this kind of SQL syntax for Updates and Deletes
> like in M$ SQL Server:
>
> DELETE T
> FROM Table1 K
> JOIN Table2 T
> ON K.KeyField = T.KeyField
> WHERE T.FieldX = Value

Is this the same as :

DELETE FROM
Table2 T
WHERE
EXISTS(SELECT 1 FROM Table1 K
WHERE K.KeyField = T.KeyField) and
T.FieldX = Value


> UPDATE K SET
> Field = T.Field2
> FROM Table1 K
> JOIN Table2 T
> ON K.KeyField = T.KeyField
> WHERE T.FieldX = Value

and this the same as :

UPDATE
Table1 K
SET
Field = (SELECT T.Field2 FROM Table2 T
WHERE K.KeyField = T.KeyField and T.FieldX = Value)
WHERE
EXISTS(SELECT 1 FROM Table2 T
WHERE K.KeyField = T.KeyField and T.FieldX = Value)

I understand that the proposed UPDATE should be more effective.
This is not an SQL-standard supported syntax, how many other engines support
this syntax? (What about Oracle, MySQL, ...)


Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81