I have a two tables called 1.ReportTableDetails and 2.SecurityDetails
ReportTableDetails
ReportName | ColumnNames | FilterNames
--------------------------------------
Total Sales | data1,data2 | data1,data2
Branch Sales | data1,data2 | data1,data2
SecurityDetails
SecurityLevel | ReportName | RColumn | RFilter
--------------------------------------------------------
1 | Total Sales | data1,data2 | data1,data2
4 | Total Sales | data1,data2 | data1,data2
I will search the records by
SecurityLevel from SecurityDetails. The condition is, if the ReportName is not found in SecurityDetails, it should pick the data from ReportTableDetails
Expecting output
SecurityLevel | ReportName | RColumnNames| RFilterNames | ColumnNames | FilterNames
---------------------------------------------------------------------------------------
1 | Total Sales | data1,data2 | data1,data2 | |
1 | Branch Sales | | | data1,data2 | data1,data2
What I tried is inner join with SecurityDetails table. it retrieves when the report names are equal. But i want to retrieve which is not in SecurityDetails table also