October 25, 2024
Chicago 12, Melborne City, USA
SQL

MariaDB SQL Query to extract json data as columns and rows


I have JSON data stored in MariaDB in a column having data type as TEXT.

Examples of 4 rows in JSON_Column of table My_Table are:

Table Row 1:
[New Values: {PSTN=0/34/25}] [Old Values: {PSTN=0/31/25/0}]

Table Row 2:
[New Values: {PASSWORD=194aa6c17f4ad64f8a38a44cb2c90c63, METHOD=7}] [Old Values: {PASSWORD=626dd7a54f2gfd7834aabbccaabb345ccb, METHOD=0}]

Table Row 3:
[New Values: {STATUS=0}] [Old Values: {STATUS=1}]

Table Row 4:
[New Values: {GROUP=223}] [Old Values: {GROUP=263}]

I am looking for solution to convert this JSON data as rows and columns as below:

enter image description here

Helping to provide expert solution will be highly appreciated.

Thanks and Regards



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video