Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PIVOT TABLE in SQL

Status
Not open for further replies.

deltaair

IS-IT--Management
Nov 3, 2005
43
CH
Hello,

I have a table with 3 columns, where person_id is unique id.
<person_id> <event_type> <number_events>

1. I need to transform this into a table with <person_id> <event_type1> <event_type2>.... <event_type-n>
And under each column I need to fill the number_events for each event_type for that person_id

2. Next step is to use that table and convert the same into % of number_events under each event_type, as % of total number_events for each id_member

Thanks
 
I believe if you don't know all possible event_type beforehand, you need to look at Dynamic Pivot in google.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top