MySQLで約2000レコードを更新する必要があります
次の値を持つテーブル'my_table'の列'my_content'があります
Title: some title here<br />Author: John Smith<br />Size: 2MB<br />
3つの新しい列(my_title、my_author、my_size)を作成しました。次に、このように「my_content」のコンテンツを分離する必要があります。
'my_title'
some title here
'my_author'
John Smith
'my_size'
2MB
タイトルを想像できるように、著者とサイズは行ごとに常に異なります。
私が考えているのは、次のクエリを実行することですが、SQLクエリは得意ではなく、実際のクエリがどのようになるかわかりません。
これが私がやろうとしていることです:
Within 'my_content' find everything that starts with "title:..." and ends with "...<br />au" and move it to 'my_title'
Within 'my_content' find everything that starts with "thor:..." and ends with "...<br />s" and move it to 'my_author'
Within 'my_content' find everything that starts with "ize:..." and ends with "...<br />" and move it to 'my_size'
これを行うためのクエリの書き方がわかりません。
すべてのコンテンツが新しい列に入ると、「thor:」など、不要になったコンテンツを見つけて削除できます。