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.

Andriy M
23.3k6 gold badges60 silver badges104 bronze badges
asked Apr 19, 2019 at 3:42
4
  • No way. And no reasons for NOT import, especially when the data is static. Commented Apr 19, 2019 at 5:15
  • You'll have to write a programme to do stuff like that! Commented 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. Commented Apr 20, 2019 at 1:49
  • This may be part of it: dba.stackexchange.com/questions/192208/… Commented Apr 27, 2019 at 4:23

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.