Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Finding Orphans |
Wed, Feb 8 2006 9:15 PM | Permanent Link |
Dave | Hi
Lets say I have three tables: tblMain: Index: AutoInc Name: String tblSubject Index: AutoInc Subject: String tblLink (which obviously links the items in the two tables above in a many to many relationship) NameIndex: Integer SubjectIndex: Integer What SQL could i use to return a list of all the Names in tblMain that do not have an entry in tblLink? Thanks SQL Gurus! |
Wed, Feb 8 2006 10:33 PM | Permanent Link |
Jeff Cook | Dave <davey.crackpot@gmail.com> wrote on Wed, 8 Feb 2006 21:15:13 -0500
>Hi > >Lets say I have three tables: > >tblMain: >Index: AutoInc >Name: String > >tblSubject >Index: AutoInc >Subject: String > >tblLink (which obviously links the items in the two tables above in a many to many relationship) >NameIndex: Integer >SubjectIndex: Integer > > >What SQL could i use to return a list of all the Names in tblMain that do not have an entry in tblLink? > > >Thanks SQL Gurus! > > > Dave SELECT M.Name FROM tblMain M LEFT OUTER JOIN tblLink L ON L.NameIndex = M.Index WHERE L.NameIndex IS NULL Cheers Jeff (no guru!) -- Jeff Cook Aspect Systems Ltd Phone: +64-9-424 5388 Skype: jeffcooknz www.aspect.co.nz |
Thu, Feb 9 2006 5:21 AM | Permanent Link |
Dave | Thanks Jeff, works great.
|
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |