I have two tables one is master table a another table is transaction table ,I want the output like master table all data and transaction table status only
Table a:
CategoryId CategoryName
1 C#
2 Java
3 Angular
4 React
5 C++
Table b:
CategoryId Status
1 Closed
3 Closed
OutPut:
CategoryId CategoryName Status
1 C# Closed
2 Java Open
3 Angular Closed
4 React Open
5 C++ Open
thanks you guys, I am waiting for your replys...


Ramachandran MRank #2,660 · 522 reputationPosted Dec 5, 2019, 11:32 PM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 5, 2019, 6:50 PM EST
SELECT T1.CATEGORYID,T1.CATEGORYNAME,CASE WHEN T2.[STATUS] IS NULL THEN 'OPEN' ELSE T2.[STATUS] END 'STATUS' FROM TABLE1 T1
LEFT JOIN TABLE2 T2 ON T1.CATEGORYID = T2.CATEGORYID
siva balan86 reputationPosted Dec 5, 2019, 11:13 PM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 5, 2019, 11:18 PM EST
siva balan86 reputationPosted Dec 5, 2019, 11:22 PM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 6, 2019, 12:42 AM EST