Re: Left Outer Join Only Including Matching Rocords
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 23 Jun 2007 00:50:13 +0200
On Fri, 22 Jun 2007 12:31:02 -0700, Stan wrote:
I am executing the following SQL statement in Management Studio in a SQL
Server 2005 environment:
Select
wl.wmslocationid,il.itemid,il.citullcastartpickinglocation,il.citullcaendpickinglocation
from wmslocation wl left outer join inventitemlocation il
on wl.wmslocationid = il.citullcastartpickinglocation
The returned set of records ONLY shows the records that have matching
entries in both tables. The records from the 'left' table are dropped from
the result. This is not behaving the way a 'left outer' should behave.
Hi Stan,
If this is the *complete* query you are sending, then you might have run
into a bug - though it would surprise me, since this is a fairly regular
kind of query and bugs usuallly only appear in obscure queries that are
not in the standard testet of MS and seldom used in the real world.
I suspect that there is another explanation - but to find it, I need to
be able to reproduce the problem. For that, I need a SQL script
containing the CREATE TABLE statements to reproduce your tables,
including all constraints, properties, and indexes; some INSERT
statements with a few well-chosen rows of sample data; the *EXACT* query
you are executing: and both the expected and real output.
I'd also like to know what version of SQL Server you have running.
Please post the result of
SELECT @@VERSION
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
.
- Prev by Date: Query blues... Help!
- Next by Date: Re: how to assigned float number to DB ?
- Previous by thread: Query blues... Help!
- Next by thread: Re: how to assigned float number to DB ?
- Index(es):
Relevant Pages
|
|