View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
I have table TA, which is like this:
Code: |
ATTR VALUE
------- -------
0001 COLA
0001 COLB
|
I have another table TB, which is like this:
Code: |
COLA COLB
------- -------
AAAA BBBB
|
that is, the column name of TB is the value of a column of TA.
I want to get below result, how to compose the sql statement?
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As usual you have not provided much to work with . . .
How many rows are in TA? TB? How many should be selected and why?
How did this particular "requirement" arise? Explain in terms of actual data and no, it is not proprietary to use fake data rather than real data. |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
I don't have specific bussiness requirement.
I just want to konw if it's feasible for DB2. |
|
Back to top |
|
|
|