mysqlのレコード取得について
+---------+------------------------+-----------------------------
|id | record1 | record2 |
+---------+------------------------+-----------------------------
| 1 | test,test1,test2,test3 | hello, hello1,hello2,hello3
|
| 3 | test1,test2,test3 | hello, hello1,hello2,hello3
|
| 2 | test1,test2,test3 | hello, hello1,hello2
|
+---------+------------------------+-----------------------------
上記のようなカンマ区切りのレコードを下記のように分割して取得する方法がありませんでしょうか?
+--+-----------+-------------
|id | record1| record2 |
+—+-----------+------------
| 1 | test | hello
|
| 1 | test1 | hello1
|
| 1 | test2 | hello2
|
| 1 | test3 | hello3
|
| 3 | test1 | hello
|
| 3 | test2 | hello1
|
| 3 | test3 | hello2
|
| 3 | null | hello3
|
| 2 | test | hello
|
| 2 | test1 | hello1
|
| 2 | test2 | hello2
|
+--+-----------+-------------
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。