I have the following two tables -
Table1
Name Age City
A 21 Delhi
B 23 Mumbai
C 35 Pune
Table2
Name Attribute Attribute_value
A Phone 999999999
A Passport A12345
A Location China
A Skills Developer
B Phone 8888888888
B Skills Tester
Now I want to create table 3 where I get the following details -
Table3
Name Age City Phone Passport Location Skills
Note- the attribute_values should come under the Phone, passport, Location and Skills headings. There should be a single row per 'Name' in table 3.
[Assuming that there are only 4 distinct values in the attribute column in Table2 and for the Name where a certain attribute can not be found, the attribute_value can be assumed as NULL]