This is my table on which I want to execute the query on the basis of two columns.I want to execute the query on the basis of first column values. It must pick the first column value if put in the where clause of the case statement
.
id | Service
-------------
123 | 4
124 | 4
125 | 3
126 | 6
-------------
Select Service
case when Service = 4 then (select size from table1 where id = {first column value})
case when Service = 3 then (select size from table2 where id = {first column value})
case when Service = 6 then (select size from table3 where id ={first column value})
End as
Size
From Services_table