Tuesday, 31 January 2017

Split the comma separated values of a single column into multiple rows


I have a column and value is 1,2,3,4,5,6. Need to split this value into rows.

Note: 1,2,3,4,5,6 is a single value under column.





Friday, 20 January 2017

Find all the positions of an occurrence of a character in a string



I have an SSN# with format 123-45-6789. Here the character '-' is repeated in 4th and 7th position of a string. I need to write an SQL query to find out the positions of that characters.