Konvertieren vom dpc-Controlcenter zu JSON-Datei

select s7013ottarif.agab,s7013ottarif.tarif,s7013ottarif.des,s7013ottarif.desxl as betreuungszeit,s8300ot.des as Schule,s7013ottarif.value as preis

from s7013ottarif JOIN s8300ot ON (s8300ot.ortsteil = s7013ottarif.ortsteil)
where s7013ottarif.ortsteil in (SELECT ortsteil FROM s8300ot )
and s7013ottarif.agab in (40,50)
and s7013ottarif.tariffield = 'gegart'
and s7013ottarif.tarif in ('A1','B1','3','5')
and (s7013ottarif.verdatt is null or s7013ottarif.verdatt = '31.12.2099')
and s7013ottarif.tarifdatt ='31.12.2099'
ORDER BY s7013ottarif.ortsteil
  1. sql im Center ausführen
  2. als excel exportieren
  3. mit openspread öffnen
  4. als ods apspeichern
  5. in Mysql einlesen und mit GROUP_CONCAT und JSON_OBJECT abfragen.
SELECT CONCAT('[', 
GROUP_CONCAT(json_object('agab',agab,
'tarif',tarif,
'des',des,
'betreuungszeit',betreuungszeit,
'ortsteil',ortsteil,
'Schule',Schule,
'Gebuehr',Gebuehr
)
)
,']' 
) FROM schule;