I want export data from my SQL database.
Simply use :
SELECT `id`,`tags` FROM `posts`
This query give me those results :
(1, 'handshake,ssl,windows'),
(2, 'office,word,windows'),
(3, 'site')
I want results in this form:
(1, 'handshake'),
(1, 'ssl'),
(1, 'windows'),
(2, 'office'),
(2, 'word'),
(2, 'windows'),
(3, 'site')
How can write a query that give me this results?
Thank you and sorry for my poor English.
3
Answers
After many search and try finally i find the solution:
If you are using SQL Server
You can apply the fuction
Check this out:
SQL Fiddle example
For a max of three words, the code below can be used. If you want more words then you just add more lines. The method may not be fully automated, but it works.