extreme help with query of 2 tables into 1 long table
- From: "BIGLU" <BIGLU@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 7 Jun 2005 10:26:02 -0700
2 tables user id is key
Table (A) 05_Users
user_id | first_name |last_name|title|dept
64|John|Doe|director|cis
65|Jane|Doe|ceo|fina
and
Table(B) 05_Users_Details
user_id | detail_cd | group_cd | detail_value
64|06|awdM0|null
64|07|awdD0|null
64|2005|awdY0|null
64|FreeText|awdTxt0|I enjoy work
64|10|awdM1|null
64|09|awdD1|null
64|2004|awdY1|null
64|FreeText|awdTxt1|still here
64|local|pfmLEVL1|null
64|natial|pfmLEVL1|null
64|aapm|pfmAAPM1|null
64|FreeText|pfmFREE1|profess
65|etc
I'm trying to creat a query that will give me all user information into one
long table with the group_cd as a 'column title' and detail_cd as 'column
value', but if it finds the 'column value' of FreeText then detail_value
should be 'column value'.
So the table would look like this.
user_id | first_name
|last_name|title|dept|awdM0|awdD0|awdY0|awdTxt0|awdM1|awdD1|awdY1|awdTxt1|pfmLEVL1|pfmLEVL1|pfmAAPM1|FREE TEXT
64|John|Doe|director|cis|06|07|2005|I enjoy work|10|09|2004|still
here|local|natial|aapm|profess
65|Jane|Doe|ceo|fina etc
Some users have more information than other users and in these cases the
'column value' can be left as blank.
I don't need a webpage, but if it will help, will use.
IF YOU HAVE A BETTER WAY TO GET ALL THE INFORMATION ANY SUGGESTIONS WOULD BE
GREAT!
.
- Follow-Ups:
- Re: extreme help with query of 2 tables into 1 long table
- From: Hugo Kornelis
- Re: extreme help with query of 2 tables into 1 long table
- Prev by Date: Re: Identity or Sequence column in non-table SELECT ?
- Next by Date: Create Query task
- Previous by thread: Identity or Sequence column in non-table SELECT ?
- Next by thread: Re: extreme help with query of 2 tables into 1 long table
- Index(es):
Relevant Pages
|
|