I have a table which consists of column names Foo & Bar where Foo is a unique ID and bar contains multi-values seperated by ~
Foo Bar
1 A~B~
2 A~C~D
I need it to be normalised as such:
Foo Bar
1 A
1 B
2 A
2 C
2 D
While I can do it from Excel by separating TEXT to Column followed by pivoting, it is not doable as I have 1 million over records and Bar column may contain up to 12 different values.
Is there a simple way which I could manipulate straight from SQL?