Friday, 6 September 2013

How can I change column names from another table rows value

How can I change column names from another table rows value

Hi there what i want to do it is: I've got 2 table first one is
Person Table
PID | Name | Surname | Area1 | Area2 | Area3 | OwnerID |
1 | John | Doe | 5 | 6 | 8 | 1 |
2 | Jack | Danniel | 8 | 2 | 4 | 2 |
second one is
Area Table
AID | Value | Name | OwnerID |
1 | Java | Area1 | 1 |
2 | Orac | Area2 | 1 |
3 | Delp | Area1 | 2 |
4 | Css | Area3 | 1 |
how can I query a result like that if I want to select Owner1 ?
PID | Name | Surname | Java | Orac | Css | OwnerID |
1 | John | Doe | 5 | 6 | 8 | 1 |

No comments:

Post a Comment