![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 6 of 6 total |
![]() |
Tue, Jul 8 2008 4:24 AM | Permanent Link |
Heiko Knuettel | DBISAM Statement : delete from table1 a left outer join table2 b on (b.idx1 = a.idx1) and
(b.idx2 = a.idx2) where b.idx3 = null Can someone translate that into EDB SQL for me ? Shame on me, but I don't know what "correlated sub-queries in the WHERE clause" are... TIA, Heiko |
Tue, Jul 8 2008 7:58 AM | Permanent Link |
"Uli Becker" | Heiko,
> delete from table1 a left outer join table2 b on (b.idx1 = a.idx1) and > (b.idx2 = a.idx2) where b.idx3 = null Untested: delete from table1 where idx1 in (select idx1 from table2 where idx3 is null) and idx2 in (select idx2 from table2 where idx3 is null) Uli |
Tue, Jul 8 2008 9:14 AM | Permanent Link |
Heiko Knuettel | Uli
thanks, but...won't work. Example : table1: idx1, idx2 1, 1 1, 2 1, 3 table2: idx1, idx2, idx3 1, 1, 1 1, 2, 1 After execution of the DBISAM query the last row of table1 would be deleted. Heiko |
Tue, Jul 8 2008 10:06 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Heiko
delete from table1 where (select idx3 from table2 where table1.idx2 = table2.idx2 and table1.idx1 = table2.idx1 ) is null Roy Lambert [Team Elevate] |
Tue, Jul 8 2008 10:37 AM | Permanent Link |
Heiko Knuettel | Roy
Thanks !! That's it. I will need a while, until I get accustomed to that... Heiko |
Tue, Jul 8 2008 10:40 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Heiko
As a bit of a PS I almost always try and create a SELECT statement before doing a DELETE. Its usually much easier to see if you got it right, and for some reason I find it easier to develop the WHERE clause for a SELECT. Once it is working its just a matter of replacing SELECT * with DELETE. Roy Lambert [Team Elevate] |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |