Re: Joins... Urgent
From: John Vinson (jvinson_at_STOP_SPAM.WysardOfInfo.com)
Date: 02/28/04
- Next message: John Vinson: "Re: Multiple records"
- Previous message: John Vinson: "Re: Join a concatenated field"
- In reply to: Mudassir Iqbal: "Joins... Urgent"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 27 Feb 2004 17:22:55 -0700
On Fri, 27 Feb 2004 14:16:09 -0800, "Mudassir Iqbal"
<Mudassiriqbal@yahoo.com> wrote:
>SELECT TabA.fldA
>FROM TabA left join TabB on TabA.FldA = TabB.FldA
>where
>TabB.FldA is nUll and TabB.FldB=66;
If there is no record in TabB that matches any record in TabA, then
the value of FldB will CERTAINLY not be equal to 66 - there isn't any
record at all so it can't have a value!
If you want to find records in TabA for which there is no
corresponding record in that subset of TabB which has FldB equal to
66, use a Subquery:
SELECT TabA.*
FROM TabA
WHERE NOT EXISTS
(SELECT TabB.FldA FROM TabB
WHERE TabB.FldA = TabA.FldA
AND TabB.FldB = 66);
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
- Next message: John Vinson: "Re: Multiple records"
- Previous message: John Vinson: "Re: Join a concatenated field"
- In reply to: Mudassir Iqbal: "Joins... Urgent"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|