Home > Archive > SQL Anywhere ultralite > May 2005 > LEFT OUTER JOIN doesn't seem to work









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author LEFT OUTER JOIN doesn't seem to work
Timothy Dean

2005-05-03, 8:23 pm

Ultralite C++ component, 9.0.2.2451

My data is as follows:

Assets.assetIDBarcode
000001
000002
000003
000004
Inpsections. assetIDBarcode,Inspe
ctions.inspectionID
000001,3

When I do the following INNER JOIN, I get the following results:

SELECT Assets. assetIDBarcode,Inspe
ctions.inspectionID FROM Assets INNER JOIN
Inspections ON Assets. assetIDBarcode=Inspe
ctions.assetIDBarcode

Results:

Assets. assetIDBarcode,Inspe
ctions.inspecionID
000001,3

When I do the following OUTER JOIN, I get the following results:

SELECT Assets. assetIDBarcode,Inspe
ctions.inspectionID FROM Assets LEFT OUTER
JOIN Inspections ON Assets. assetIDBarcode=Inspe
ctions.assetIDBarcode

Results:

Assets. assetIDBarcode,Inspe
ctions.inspecionID
000001,NULL
000002,NULL
000003,NULL
000004,NULL

I should be getting the following results:
000001,3
000002,NULL
000003,NULL
000004,NULL

Any idea why the outer join isn't working correctly? Thanks.

Timothy Dean
MobileDataforce


Tom Slee

2005-05-06, 1:23 pm

It is difficult to know what the cause of this is without seeing the
database schema, as any problems in this area are closely tied to the
presence of indexes, foreigh keys, and other constraints. Any chance of
send it to us?

Tom Slee
iAnywhere Product Management

Timothy Dean wrote:
> Ultralite C++ component, 9.0.2.2451
>
> My data is as follows:
>
> Assets.assetIDBarcode
> 000001
> 000002
> 000003
> 000004
> Inpsections. assetIDBarcode,Inspe
ctions.inspectionID
> 000001,3
>
> When I do the following INNER JOIN, I get the following results:
>
> SELECT Assets. assetIDBarcode,Inspe
ctions.inspectionID FROM Assets INNER JOIN
> Inspections ON Assets. assetIDBarcode=Inspe
ctions.assetIDBarcode
>
> Results:
>
> Assets. assetIDBarcode,Inspe
ctions.inspecionID
> 000001,3
>
> When I do the following OUTER JOIN, I get the following results:
>
> SELECT Assets. assetIDBarcode,Inspe
ctions.inspectionID FROM Assets LEFT OUTER
> JOIN Inspections ON Assets. assetIDBarcode=Inspe
ctions.assetIDBarcode
>
> Results:
>
> Assets. assetIDBarcode,Inspe
ctions.inspecionID
> 000001,NULL
> 000002,NULL
> 000003,NULL
> 000004,NULL
>
> I should be getting the following results:
> 000001,3
> 000002,NULL
> 000003,NULL
> 000004,NULL
>
> Any idea why the outer join isn't working correctly? Thanks.
>
> Timothy Dean
> MobileDataforce
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com