I have some static data which stored in a JSON file:


and I have a table:

| id | label | out_id |  
| 1  |   a   |   123  |
| 2  |   b   |   123  |

I wanna select all info out like


It is easy to achieve that by importing the outside JSON data into DB table, and select them out through a simple left join query. But I wanna know how to achieve that if I don't create a table for those static data.

  • No way. And no reasons for NOT import, especially when the data is static. – Akina Apr 19 at 5:15
  • You'll have to write a programme to do stuff like that! – Vérace Apr 19 at 20:23
  • yes,i was always vacillate in these little decitions. more left join always make me think things come more complex. but if i select the origin data out, then enhance them with other json data by outside program, the complex is apparent. so,i keep them in db at last. – Kent Wood Apr 20 at 1:49
  • This may be part of it: dba.stackexchange.com/questions/192208/… – Rick James Apr 27 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.