Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 2 of 2 total |
Delete with inner join |
Wed, Nov 18 2009 4:48 AM | Permanent Link |
"James Relyea" | I'm not sure if delete statements with an inner join is a supported syntax
or not, but if it is, could someone post a syntax sample? I can't quite seem to get it right this morning. Thanks jr |
Wed, Nov 18 2009 5:15 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | James
Don't think so. You need to use a sub-select instead. This is one I build programmatically Archiver.SQL.Text := 'DELETE FROM ' + Source + ' WHERE'; if Zaps[Block] in [0, 2] then Archiver.SQL.Add('(SELECT _ID FROM Contacts WHERE Contacts._ID = ' + Source + '._fkContacts ) IS NULL'); if Zaps[Block] = 2 then Archiver.SQL.Add('AND'); if Zaps[Block] in [1, 2] then Archiver.SQL.Add('(SELECT _ID FROM Companies WHERE Companies._ID = ' + Source + '._fkCompanies ) IS NULL'); Archiver.ExecSQL; Roy Lambert [Team Elevate] |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |