Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

TSQL query

$
0
0

Hi All,

I am joining 4 tables below is the my syntax 

Select P1.Created,P2.[HQ Partner ID],P2.[HP Organization], P2.[Country],p2.[HQ Partner ID],p2.[Partner English Name],p2.[HQ Channel Segment],
Case 
When P3.[HQ Partner ID]=P2.[HQ Partner ID] then 'Yes'
Else 'No'
end as [SBSO verified(Y/N)],
Case When P4.[Partner ID]=P2.[HQ Partner ID] then P4.[Contract Type] 
Else '-' End as[Contract Type], P4.[Agreement #] as [Active Agreement type(if any)]
from [dbo].[PartnersCreated] P1 Right outer Join [dbo].[Radar-Check_1_2]
 P2 on P1.[Partner ID]=P2.[HQ Partner ID] Left Outer Join [dbo].[Radar-SBSO-Check_01] P3
 On P3.[HQ Partner ID]=P2.[HQ Partner ID] left outer Join [dbo].[Agrements_SBSR] P4
 On P3.[HQ Partner ID]=P4.[Partner ID]

Here P4.[Contract Type] values is not coming in result set it is only coming as '-'

Kindly help.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>