1

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

outinfo=
[{out_id:123,out_name:'hello'}]

and I have a table:

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

I wanna select all info out like

{id:1,label:"a",out_name:"hello"}

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.

4
  • No way. And no reasons for NOT import, especially when the data is static.
    – Akina
    Apr 19, 2019 at 5:15
  • You'll have to write a programme to do stuff like that!
    – Vérace
    Apr 19, 2019 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, 2019 at 1:49
  • This may be part of it: dba.stackexchange.com/questions/192208/…
    – Rick James
    Apr 27, 2019 at 4:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.