Given with the sample and desired result. Would this be possible without using a cursor and plainly select statements?Sample data...select 1 as sID, '01110' as code union allselect 2 as sID, '11110' as code union allselect 3 as sID, '101111' as code
Desired result...select 1 as sID, 0 as c1, 1 as c2, 1 as c3, 1 as c4, 0 as c5, null as c6 union allselect 2, 1, 1, 1, 1, 0, null union allselect 3, 1,0,1,1,1,1
For fast result follow this...http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxWant Philippines to become 1st World COuntry? Go for World War 3...