学习MySQL如何三个表进行连接,理解内连接和左右连接的区别,实现方式如下:

SELECT

    p.case_id,

    p.action_user_name,

    p.node_name,

    p.receive_time,

    p.action_time,

    p.action_type,

    p.action_detail,

    p.description_international,

    c.subject,

    o.content

FROM

    bpm_process_log p

JOIN

    bpm_case c

ON

    p.case_id = c.id

LEFT JOIN

    opinion o

ON p.case_id = o.object_id

WHERE

    c.template_id = 2009996271707753870

    AND p.receive_time > '2024-1-1 00:00:00'

    AND p.receive_time < '2025-1-1 00:00:00'