News for hackers. Stuff that matters.
Re:Writing more legible SQL by 83457 on Thursday November 03, 2016 @04:41AM (#12862406)
I think of joins as operators and from as the block similar to and/or in the where clause. He is being inconsistent with line breaks for select, from and where blocks. Personally I want to be able to visually pick out the blocks of the query and the easiest way to do that is with indention imo.
Re:Writing more legible SQL by 1wd on Thursday November 03, 2016 @08:01AM (#12863241)
If "joins" are operators like "and", and you put "and" at the end of the line, shouldn't you put "join" at the end too?

    from
        table1 t1 join
        table2 t2 on t1.col2 = t2.col1 join
        table3 t3 on
            t1.col3 = t3.col1 and
            t3.col2 = something_else
Re:Writing more legible SQL by 83457 on Thursday November 03, 2016 @09:50AM (#12863902)
well I don't put and/or at the end of lines so there is that... but I have seen people but joins at the end of lines
Re:Writing more legible SQL by 1wd on Thursday November 03, 2016 @02:05PM (#12866372)
sorry, mistook you for the top-level poster.