Skip to content

Instantly share code, notes, and snippets.

@ti-ka
ti-ka / Retrive Json Data from Mysql.sql
Created March 10, 2017 16:34
If you have saved data into a field as json, you can use mysql to retrieve each field. It may be useful in migrating database when you have decided that using JSON in a database was not a good idea.
/* APPENDIX 1-B: CLEANUP
This makes this sql query re-run able */
DROP TABLE IF EXISTS JSON_TABLE;
DROP TABLE IF EXISTS SPLIT_TABLE;
DROP VIEW IF EXISTS SPLIT_VIEW;
/* APPENDIX 1-B: Prepare TABLE
Let's say this is an example table */