DEV Community

[Comment from a deleted post]
Collapse
 
dmfay profile image
Dian Fay

I've used right joins a handful of times, most recently joining a table of weather stations to a CTE representing intervals during which stations were or weren't deployed (the latter being of primary interest). Left joins are certainly much more intuitive in almost all cases, but I suspect that has more to do with English-readers being used to processing left to right than anything else.

 
aarone4 profile image
Aaron Reese • Edited

In which case it should have been

SELECT 
        CTE.column
        ,STATION.data
FROM
        CTE
    LEFT JOIN STATION ON STATION.CTE_ID = CTE.ID