0

Is there any way to export the result-set obtained after applying multiple joins on the several mySQL tables into the JSON format?

It could be better understood with below sample select statement

SELECT * FROM table1
INNER JOIN table2 on table1.col = table2.col

I have to generate the above obtained data into JSON format. Is there any direct option/command available to the select statement by which I can do it?

Alex
  • 878
  • 1
  • 10
  • 25
Himmat
  • 166
  • 5
  • You need to specify your backend language. PHP? And where you want to get JSON string? In PHP variable, MySQL resulting string or anywhere else? – Igor Melekhov May 16 '19 at 06:57
  • You can do it by writing simple python script Ex: https://stackoverflow.com/questions/3286525/return-sql-table-as-json-in-python – Player_Neo May 16 '19 at 09:30

1 Answers1

1

Yes, If you are using phpmyadmin there is an option to export data to any format.

Click on the export button there is a dropdown to export data to any format

You will get JSON file with your desired result set