Shertson@lemmy.world to New Communities@lemmy.world · 1 year agoSQL - any and all dialects and versionslemmy.worldexternal-linkmessage-square3fedilinkarrow-up17arrow-down10file-text
arrow-up17arrow-down1external-linkSQL - any and all dialects and versionslemmy.worldShertson@lemmy.world to New Communities@lemmy.world · 1 year agomessage-square3fedilinkfile-text
minus-squareLittle8Lost@lemmy.worldlinkfedilinkarrow-up2·edit-21 year agoyou 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
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:
It is helpful to see if connected data exists or not