MySQL: select words as strings, even som - "new line", separated in one field

I have a table with a field where the words are written in separated new lines. Thus, a choice in this separate field from lines will output 3 lines for the first line and 2 lines for the second line:

Row1    designationer
        nye kolonier
        mindre byer
Row2    udsteder
        bopladser

I would like to make a selection that selects all these rows, as if they were rows in a table, for example:

SELECT do_the_split(field) FROM table

so the result will be more like:

Row1    designationer
Row2    nye kolonier
Row3    mindre byer
Row4    udsteder
Row5    bopladser

Is there a way to do this in MySQL?

BR. Anders

UPDATE: The following are the correct answers, but in the end it is done semi-automatically. I have done this:

  • export column to csv
  • Open the file in notepad and delete the pings around each line
  • now every word is on a new line
  • save as csv
  • import to the database where each row will be a new row

Br. Anders

+3
3

- , - , , .

, , MasterPeter.

+2

, , , - ( , , Derby DB) script/program.

+1

, in-and-outs mySQL - , ? , , , Java ( PHP - ),

String row = <fetch row from resultset>;
String[] individualItems = row.split("\n");

, , .

0

Source: https://habr.com/ru/post/1737679/


All Articles