November 21, 2015 at 5:19 am
I thought this was simple and it probably is but I have searched for 3 days with no solution. I think part of my problem is I don't know how to word it for the search engine. Here is a sample of what I would like my result to be based on the data from the first 5 rows to give me the sixth row which is the pivot of the Type column and B field Value only.
IdentifierTimeTypeValue Etc Type_B
D1 1/1/2015 0:00A310"1"
D11/1/2015 0:00B"1"20"1"
D11/1/2015 0:00C230"1"...
D11/1/2015 1:00A3100
D11/1/2015 1:00B0200
D11/1/2015 1:00C2300
D11/1/2015 2:00A3101
D11/1/2015 2:00B1201
D11/1/2015 2:00C2301
D21/1/2015 0:00A310"0"
D21/1/2015 0:00B"0"20"0"
D21/1/2015 0:00C230"0"...
D21/1/2015 1:00A3101
D21/1/2015 1:00B1201
D21/1/2015 1:00C2301
D21/1/2015 2:00A3100
D21/1/2015 2:00B0200
D21/1/2015 2:00C2300
Any help would be greatly appreciated.
Thanks,
Rich:hehe:
November 21, 2015 at 9:12 am
Your question is not clear to me. Please provide sample data, DDL and desired results in a consumable form, as described in the first link in my signature.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
November 22, 2015 at 8:34 am
All data you would need is there. I don't have any DDL's as this is a sample. The original table if I had one would be the first 5 columns of the data above.
To ask a question then here goes, for each row containing the same identifier and date/hour I need the "VALUE" of the column "TYPE" where "TYPE" = "B" placed in the column "TYPE_B" for each row.
As for the results it would look like what is shown above. The "ETC" column just denotes that I have other columns that need to be displayed in the results.
Thanks,
Rich
November 22, 2015 at 9:17 am
o324712 (11/22/2015)
All data you would need is there. I don't have any DDL's as this is a sample. The original table if I had one would be the first 5 columns of the data above.To ask a question then here goes, for each row containing the same identifier and date/hour I need the "VALUE" of the column "TYPE" where "TYPE" = "B" placed in the column "TYPE_B" for each row.
As for the results it would look like what is shown above. The "ETC" column just denotes that I have other columns that need to be displayed in the results.
Thanks,
Rich
Rich, if you want a little coded help on this, please read the article at the first link in my signature line below for how to provide some readily consumable data.
If you don't want coded help, then lookup "Converting Rows to Columns" in Google.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 22, 2015 at 9:41 am
Okay, thanks for the suggestions.
Rich
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply