I have a requirement to convert distinct row values into columns. The following table is available with Source, Priority and Count.
|Source |Priority|Count|
|Email |P4 |19 |
|Phone |P3 |27 |
|Email |P3 |53 |
|Outlook|P4 |77 |
|Email |P2 |12 |
Now I have to generate the output in below tabular format in a JSP page. Can this output table be generated using SQL?
|Source |P4|P3|P2|P1|
|Email |19|53|12|0 |
|Phone |0 |27|0 |0 |
|Outlook|77|0 |0 |0 |