Export MySQL to Json: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Created page with "<pre> SELECT CONCAT("[", GROUP_CONCAT( CONCAT("{Menue:'",mysql_Table_1,"'"), CONCAT(",Text_D:'",mysql_Table_2),"'}") ,"]") ..."
 
No edit summary
Line 1: Line 1:
<pre>
<pre>
SELECT  
 
    CONCAT("[",
SET SESSION group_concat_max_len = 100000000;
          GROUP_CONCAT(
 
              CONCAT("{Menue:'",mysql_Table_1,"'"),
SELECT
              CONCAT(",Text_D:'",mysql_Table_2),"'}")
  CONCAT("[",
    ,"]")  
  GROUP_CONCAT(
AS json FROM menu;
      CONCAT("{ \"Menue\": \" ", Menue  , " \" "),
      CONCAT(", \"Text_D\": \" ", Text_D), " \"}")
      ,"]")
AS json FROM menu ;


</pre>
</pre>

Revision as of 13:30, 4 October 2013


SET SESSION group_concat_max_len = 100000000;

SELECT
  CONCAT("[",
   GROUP_CONCAT(
       CONCAT("{ \"Menue\":  \" ",  Menue  , " \" "),
       CONCAT(", \"Text_D\": \" ",  Text_D), " \"}")
       ,"]")
AS json FROM menu ;