Need help with sql coding
Posted on 2011-09-09
Project | PONum | PODesc
200078 3152000745 PTNumber
200078 3153000135 CANumber
200078 3153000235 CANumber
200090 3153000234 PTNumber
For the above give sample table, I should get a result as below: For every project number if there are multiple PONum, I need to consider only the first two and display them as PONum1(3152000745), PONum2 ,PODesc1 and PODesc2 resp.
ex the above table should show as below:
project | PONum1 | PODesc1 | PONum2 | PODesc2
200078 | 3152000745 | PTNumber | 3153000135 | CANumber
200090 | 3153000234 | PTNumber | |
Please note that the third PONumber for the first project number is ignored. only the first two are considered.