How to get Multiple Row Values
Asked Answered
K

1

0

It is the question in continuation to my old post. If you want to see the codes of the below image then follow the below link, and solve my problem please.

How to Multiply two Column values and display its Result at the end of each Row?

https://mcmap.net/q/1483265/-how-to-multiply-two-column-values-and-display-its-result-at-the-end-of-each-row/11203135

Image

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

Question

I have attached a link of Screenshot. Kindly see the Screenshot and tell me how can I add multiple jobs per user ID?

For Example, Screenshot have User ID 216020 and the user has Two Job Locations rows i.e. Civil and Office Work, it has Two Salary rows i.e. 150 and 200, it has Two Allowance rows i.e. 0 and 0, it has Two Days rows i.e. 17 and 13, finally it has Two Total rows i.e. 1950 and 2600 (Total is generated through the Multiplication of Salary and Days) and there is a Total of Total at the end of the Table. I am not able to get multiple row values per user ID. Kindly tell me how can I get those row values per User ID?

Kornher answered 1/7, 2012 at 13:42 Comment(3)
YOur link isn't a link and it doesn't work anyway. Are you saying you want to split one row into two based on user id?Clem
which links isn't a link. I have updated the link, kindly check now.Kornher
@TonyHopkinson Are you saying you want to split one row into two based on user id? Yes, you are right, I want to split one row into two per user ID.Kornher
C
0

Given MyTable of ID,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

Surely???

Clem answered 2/7, 2012 at 15:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.