LEFT JOIN Question
- From: "David Fabian" <david.m.fabian@xxxxxxxxxxxxx>
- Date: Sat, 27 Jan 2007 15:58:07 GMT
TableA TableB
Name ID_A ID_A MoreData
AAA 1 1 111
BBB 2 1 222
CCC 3
SELECT * FROM TableA
LEFT JOIN TableB ON TableA.ID_A = TableB.ID_A
The above returns:
Name ID_A MoreData
AAA 1 111
AAA 1 222
BBB 2 Null
CCC 3 Null
I am trying to pull TableB records WHERE MoreData != 111, so I used:
SELECT * FROM TableA
LEFT JOIN TableB ON TableA.ID_A = TableB.ID_A
WHERE MoreData != 111
Which returns:
Name ID_A MoreData
AAA 1 222
How can I get SQL Server to return these records?:
Name ID_A MoreData
AAA 1 222
BBB 2 Null
CCC 3 Null
Dave
.
- Follow-Ups:
- Re: LEFT JOIN Question
- From: Steve
- Re: LEFT JOIN Question
- From: Ed Murphy
- Re: LEFT JOIN Question
- Prev by Date: basic web front-end tutorial
- Next by Date: Re: LEFT JOIN Question
- Previous by thread: basic web front-end tutorial
- Next by thread: Re: LEFT JOIN Question
- Index(es):
Relevant Pages
|
Loading