Please see below to understand what I want:
------------------------------ Friend | User ------------------------------ 2 | 1 3 | 2 2 | 5 4 | 2 ------------------------------
When I search for a value of 2 , I want the result of my search to return the associated values ββin Friend and User , as shown below:
-------------------------- Friends of 2 -------------------------- 1 - (from column User ) 3 - (from column Friend) 5 - (from column user ) 4 = (from column friend )
I need a column search result as shown below:
-------------------------- Friends of 2 -------------------------- 1 3 5 4
How to do this using a SELECT query in SQL Server?
source share