mysql - Create multi column view from single column data -
i have following result sql query:
eventid p_num pn_namecount1 pn_name abc-i-10942683 1089213 1 company 1 abc-i-10942683 1326624 8 company 2
i still learning capability in sql , need assistance, pivot's not working in scenario.
i have tried several different ways in attempting this, not able create desired results:
eventid p_num1 pnc1 pn_name pnc_num2 pnc2 pn_name abc-i-10942683 1089213 1 company 11326624 8 company 2
the eventid
change based on different events companies, eventid
based on particular date event occurred company.
this sample of 500k+ rows of data working with. go temp table joined other various pieces of data needed.
i have tried without success:
select key, max(col1) col1, max(col2) col2, max(col3) col3 table group key
select eventid , min(p_num) p_num1, min(pn_namecount1) pnc1, min(pn_name) pn_name1 , max(p_num) p_num2, max(pn_namecount1) pnc2, max(pn_name) pn_name2 table group eventid
this answer stated question. , stated in comment extend it.
Comments
Post a Comment