Last post Jan 21, 2016 11:11 AM by Kothapally
Jan 21, 2016 08:18 AM|Kothapally|LINK
I have 2 tables as below with data as below
Now i want to fetch final rsult as follows
Preference Name Show
1 DashboardOpportunitiesPanelSortOrder True
2 DashboardAdherencePanelSortOrder True
3 DashboardMacPanelSortOrder True
4 DashboardAuditsPanelSortOrder True
5 DashboardPerformancePanelSortOrder True
6 DashboardMTMPanelSortOrder True
7 DashboardMedicationSynchronizationPanelSortOrder True
Here we have to compare Names from table1 and Table2
Example: DashboardOpportunitiesPanelSortOrder from table1 and DashboardOpportunitiesPanelSortOrderShow from Table2 is same. So, we have to display that show column here for that "DashboardOpportunitiesPanelSortOrder"
Can anyone help me to acheive this.
Jan 21, 2016 10:22 AM|gimimex|LINK
case when exists (select 1 from Table2 as t2 where t2.Name = t1.Name + 'Show')
end as Show
from Table1 as t1
Hope this help
Jan 21, 2016 11:11 AM|Kothapally|LINK
With little modification of given query i achieved the result.