I shall appreciate some help. I have two tables in an SQL Server. I want to get 2 row level columns should be column level. If I join 2 tables, i am getting Cartesian product.
table 1:
emp_Id name age
----------------------
101 aaa 20
102 bbb 30
table 2:
p_id emp_id type ph_no
-----------------------------------
1 101 201 8888
2 101 202 9999
3 101 203 7777
4 102 201 1111
5 102 202 2222
6 102 203 3333
Expected output:
emp_Id name age 201# 203#
----------------------------------------
101 aaa 20 8888 7777
102 bbb 30 1111 3333