How to get multiple row values

This is a question of continuing my old post. If you want to see the codes for the following image, then follow the link below and solve my problem.

How to multiply two column values ​​and display its result at the end of each row?

stackoverflow.com/questions/11202617/how-to-multiply-two-column-values-and-display-its-result-at-the-end-of-each-row/11203135

Picture

http://www.koolfree.com/ImageUpload/uploads/1341093148.jpg

Question

I attached a link to the screenshot. Please view the screenshot and tell me how can I add multiple tasks for each user ID?

For example, in the screenshot there is user ID 216020 , and the user has two lines of the Workplace , i.e. Civil and Office work strong>, he has two lines of Salary , i.e. 150 and 200 , it has two Allowance lines, i.e. 0 and 0 , it has two lines Days , i.e. 17 and 13 . Total , i.e. 1950 and 2600 (Total is generated by multiplying salaries and days), and at the end of the table. I cannot get multiple row values ​​for each user id. Please tell me how can I get these string values ​​for each user id?

0
source share
1 answer

Given MyTable identifier, A1, A2, B1, B2, C1, C2

then it's just something like

Select ID,A1 AS Value1 ,B1 as Value2 ,C1 AS Value3 From MyTable Union All Select ID,A2,B2,C2 From MyTable 

Of course???

0
source

All Articles