David Glover
asked on
How to join these two data sources to produce the output shown?
Hi there, given the above image, what SQL command would join the desired output. All my join experiments failed to return all data or returned nulls. I thought about using isnull but in some cases it was the key column that was null and I wasn't sure if this was the right approach.
Thank you!
SQL Server 2000 answer required.
Thank you!
SQL Server 2000 answer required.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>"nulls came back instead of 0's "
...
so use ISNULL()
, Cars
, ISNULL(Cars,0)
...
so use ISNULL()
, Cars
, ISNULL(Cars,0)
ASKER
Whilst Paul your solution looked elegant it wasn't quite what was needed , nulls came back instead of 0's which I think I could get around by using isnull. Randys solution worked great. Paul spotted the deliberate mistake on my primary key name joining customer on customerid in his example :)