Subject | Re: [ib-support] Re: delete and join syntax |
---|---|
Author | Nando Dessena |
Post date | 2002-04-25T06:54:51Z |
Marco,
clause to a delete statement and use it to locate the rows to delete by
means of joins. You still have to specify one and only one target table.
My personal opinion about this enhancement is that its syntax is ugly
both to write and to read (eg. delete from table1 from table1 join
table2 on table1.key = table2.foreignkey) where table2.someattribute =
somevalue), but gains you excellent performance over the "where exists"
alternative.
Could it be a good enhancement for Firebird? Dunno.
The very same applies to update statements.
Ciao
--
____
_/\/ando
> Is this the only, correct way of doing things with delete? Or is there a join syntax for that purpouse? Searching google I've found that syntax used, but I don't know if were good advices or not ;)It is a Microsoft SQL Server extension; you can attach a complete from
clause to a delete statement and use it to locate the rows to delete by
means of joins. You still have to specify one and only one target table.
My personal opinion about this enhancement is that its syntax is ugly
both to write and to read (eg. delete from table1 from table1 join
table2 on table1.key = table2.foreignkey) where table2.someattribute =
somevalue), but gains you excellent performance over the "where exists"
alternative.
Could it be a good enhancement for Firebird? Dunno.
The very same applies to update statements.
Ciao
--
____
_/\/ando