|
Rob,
Here are the three equivalent ways to check for unmatched records. The first
method seems to run the fastest:
Select records in the city master that do not have a matching record in the
state master:
Select CCITY, CSTATE From CITYMAST Exception Join STATEMAST On CSTATE = SSTATE
Above using sub-select:
Select CCITY, CSTATE From CITYMAST Where Not Exists (Select SSTATE From
STATEMAST Where CSTATE = SSTATE)
Above using quantified comparison:
Select CCITY, CSTATE From CITYMAST Where CSTATE *= All(Select SSTATE From
STATEMAST)
David Morris
>>> Rob Berendt <rob@dekko.com> 03/08/99 02:05PM >>>
Does anyone have a good example of the SQL exists predicate? I am having a
tough time understanding how this is used.
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.