I work on SQL server 2012 and have table parts have two field
- partId int
- PartDone nvarchar(50)
- partId partDone
- 555444 0012
- 911877 0221
I need to loop within partDone field
if 0 then no
if 1 then yes
if 2 then null
FinalResult
- partId partDone first second third four
- 555444 0012 no no yes null
- 911877 0221 no null null yes
and I need to divide them to yes or no or null based on position of every number
What I have tried:
select partId,partDone from Parts


Vishvjit ShindePosted Mar 13, 2020, 4:06 AM