请教一下我这个SQL语句该怎么写,才能得到数据结果

查询语句
select * from tb_manager_auth g LEFT JOIN tb_trace_group a on g.traceGroupID = a.traceGroupID where g.managerID='3'
相关表:
image.png
image.png
image.png
image.png
数据结果:
[{"traceGroupID":20,"name":"养殖1","prohibit":"0","addtime":"2020-05-08 17:04:45","sort":1,"del":"0","trace":[{"traceID":99,"name":"rr","enName":"rr","status":"1","addtime":"2020-05-16 08:56:46","del":"0","relation":105,"node":"2","sort":69,"pivot":{"id":30,"traceGroupID":20,"traceID":99}},{"traceID":100,"name":"打耳标","enName":"ear_tag","status":"1","addtime":"2020-05-16 10:25:39","del":"0","relation":0,"node":"1","sort":78,"pivot":{"id":29,"traceGroupID":20,"traceID":100}}]},{"traceGroupID":2,"name":"检疫","prohibit":"0","addtime":"2020-04-24 14:33:29","sort":4,"del":"0","trace":[{"traceID":105,"name":"检疫","enName":"quarantine","status":"1","addtime":"2020-05-20 09:23:46","del":"0","relation":100,"node":"0","sort":80,"pivot":{"id":31,"traceGroupID":2,"traceID":105}}]},{"traceGroupID":1,"name":"养殖","prohibit":"1","addtime":"2020-04-24 14:32:26","sort":5,"del":"0","trace":[]}

阅读 228
评论
    1 个回答

    请把问题描述清楚

      相似问题
      推荐文章