×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Like most things, there are several options. If you had a single-field
key for the header you could:
Select * from detail where HeaderKey not in (select Key from
Header)
There are some "hacky" things you can do like that w/multiple keys where
you munge them into one like:
Select * from detail where char(HeaderKey1) + char(HeaderKey2)
not in (select char(key1)+char(key2) from header)
If you had header keys of 12345 and 67890 then you'd end up with a
concatenated string of '1234567890', but it's hacky. :)
In your case I'd go more for the outer join approach:
Select fieldIcareAbout1, FieldIcareAbout2,... from detail
Left outer Join header on detail.FK1=header.Key1 and
detail.FK2=header.Key2
Where Header.Key1 is null
The outer join will return all the detail rows regardless of their match
in header, and the fields from header will be null if there's no match.
So you then check a field from header that can't be null (a key?) and if
it's null there was no match.
-Walden
--
Walden H Leverich III
Tech Software
(516) 627-3800 x3051
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com
Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)
As an Amazon Associate we earn from qualifying purchases.