Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Conditional Join Statement

$
0
0
Hi, it's my first time here.I'm trying to write a query that will do an full join and create a column with rows that have joined being displayed and the rows that have not being set as 'No'. This is what I have so far....SELECT dbo.dwlist.DOMID, dbo.dwlist.SPID, dbo.quarter.[Design_End_Customer OEM], dbo.quarter.Design_NameFROM dbo.dwlist FULL OUTER JOIN dbo.quarter ON dbo.dwlist.DOMID = dbo.quarter.RecordIDIF DOMID IS NULLTHEN UPDATE dwlist Set DOMID = 'NO' WHERE DOMID IS NULL ;ELSE FULL OUTER JOIN dbo.quarter ON dbo.dwlist.DOMID = dbo.quarter.RecordID;END IFI don't know if I am on the right track, your suggestions are much appreciated.

Viewing all articles
Browse latest Browse all 3145

Trending Articles