0

I´m new to MariaDB. I have imported a Json.file in my MySQL Workbench. But e.g. the authors are all in one line instead each author in one line.

Is there a way to split them up, so each author gets a new line like this:

Lucinda Riley\n
Margit Steinborn\n

product_author:
["Lucinda Riley", "Margit Steinborn", "Don Winslow", "Laila Maria Witt", "Klaus-Peter Wolf", "Evelyn Weigert", "Sarah Sprinz", "Vincent Kliesch", "Eva Almst\u00e4dt", "Juliane Maibach", "Lisa Oliver", "Elias Haller"]
Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
Marco
  • 35
  • 5
  • Please let us know what does `SELECT VERSION();` return? There's a good solution in MySQL 8.0, but this task is quite hard in older versions. Your question is virtually the same as one I answered before: https://stackoverflow.com/a/60250840/20860 – Bill Karwin Jun 09 '22 at 17:15
  • Hi, thx for answer. It returns 10.4.24-MariaDB – Marco Jun 09 '22 at 17:19
  • MariaDB does not support the JSON_TABLE() function until version MariaDB 10.6 (see https://mariadb.com/kb/en/json_table/). I suggest you just fetch the JSON string as is into your application, and split it up using code. – Bill Karwin Jun 09 '22 at 17:30
  • FYI MariaDB is not MySQL. MariaDB started as a fork of MySQL in 2010, but both products have been changing since then. In particular, their support for JSON has been implemented after the fork, so they are completely independent. You should not think of MariaDB as compatible with MySQL. – Bill Karwin Jun 09 '22 at 17:32

0 Answers0