Create new rows for each id based on location

Hi All, I have data in a table as below, id,id2,location 1, k12, CA, WA, NY 2,K8,VA,TX can someone please tell me how can I get desired output as shown below. expected output: id,id2,location 1,k12,CA 1,k12,WA 1,k12,NY 2,k8,VA 2,k8,TX Thanks

Posted in SQL