I would like some help on how to create a SQL query that would look at 'Category 1-9' columns and append the number according to the index listed below to the CategoryIds column separated by a comma. If the column is NULL, then skip over to the next column. The final result highlighted in yellow as an example.
I would like to run this query on every row from 'Category 1-9' columns and append the results to CategoryIds column . BIG THANKS!!!