Come share your knowledge, announcements, and questions with the community.

  • Little8Lost@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    1 year ago

    you can make:
    `SELECT table.name, table2.conditionOrSomething, table3.anotherCondition

    FROM table

    LEFT JOIN table2 ON table.id1=table2.id1 OR NULL

    LEFT JOIN table3 ON table.id1=table3.id1 OR NULL

    GROUP BY table.id1; `
    That way you can get responses like:

    • “asdf”, NULL, NULL
    • “asdf”, true, NULL
    • “asdf”, false, 2

    It is helpful to see if connected data exists or not