General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
SQL Question - Joins
I need to perform a query on two tables in SQL Server 2000.
I need to pull everything from table2 with the values from table one, if the type matches use that value, otherwise if the type dosen't match I need to use the value where the type is null.
Example:
Table1 Table2
Style Type Vaule Style Type
---------------- -----------
a <null> 1 a 5
a 1 .9 a 1
a 2 .8 a 3
b <null> 1.1 a 2
b 1 1 b 4
c <null> 1.2 c 4
c 3
c 1
Desired Output
Style Type Value
-----------------
a 5 1
a 1 .9
a 3 1
a 2 .8
b 4 1.1
Any ideas?
Thanks