Subject | Re: [firebird-support] Re: SQL Question - "Not In" Query |
---|---|
Author | Daniel Rail |
Post date | 2004-09-16T08:46Z |
Hi,
At September 16, 2004, 00:57, ra8009 wrote:
orders. Not just the orders where CUST_ID is null, but also those
where ORDERS.CUST_ID is not found in CUSTOMERS. This is useful if by
mistake a customer was deleted without the corresponding orders being
deleted, I'm pretty sure your application does deal with that, but
just in case you forgot to implement that logic or someone deleted a
customer directly from the database.
thorough.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At September 16, 2004, 00:57, ra8009 wrote:
> Thanks for the tip. Do you mean that the syntax you suggested is moreI don't know about the fastest, but it will give you all orphan
> efficient?
orders. Not just the orders where CUST_ID is null, but also those
where ORDERS.CUST_ID is not found in CUSTOMERS. This is useful if by
mistake a customer was deleted without the corresponding orders being
deleted, I'm pretty sure your application does deal with that, but
just in case you forgot to implement that logic or someone deleted a
customer directly from the database.
> Is that becuase my syntax will first perform the join andWhen it comes to find orphaned orders like this, you got to be
> then narrow it down to just the ones that are NULL?
thorough.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)