sql - splitting one column into several -


first time poster here, please forgive mishaps.

i have query in sql sake of simplicity returns duration, business duration , impacted service. problem lies in fact if impacted service, has more 1 value in row. example can 'crm, payrol , scheduling'. see below.

duration business duration impacted service 60 40 crm 100 95 payroll 70 70 scheduling 50 45 crm,scheduling, scheduling

what want individual row each of values inside one. so:

duration    business duration   impacted service 60                 40                  crm 50                 45                  crm 100                95                payroll 50                 45                payroll 70                 70               scheduling 50                 45               scheduling 

how go it?

thanks!

one method uses split function. google "sql server split function" on web. have split function.

you can outer apply:

select t.duration, t.business_duration, s.impacted_service t outer apply      (dbo.split(t.impacted_service)) s(impacted_service); 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -