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条答案
按热度按时间kzipqqlq1#
If you are using SQL Server You can apply the fuction
STRING_SPLIT
Check this out: SQL Fiddle example
lzfw57am2#
After many search and try finally i find the solution:
c9qzyr3d3#