News for hackers. Stuff that matters.
Re:Best practices for writing SQL queries by hn_throwaway_99 on Saturday April 10, 2021 @02:55PM (#26764010)
The indentation rules never change. Fortunately, "SELECT" at six letters is as long as the longest first word that starts a clause, which is why when doing, for example, a "LEFT JOIN" you line up the "LEFT" and not the "JOIN, e.g.

  SELECT a.foo
    FROM alpha a
    JOIN beta b ...
would become

  SELECT a.foo
    FROM alpha a
    LEFT JOIN beta b ...
Any diff tool correctly highlights the only change is the LEFT.
Re:Best practices for writing SQL queries by sodapopcan on Saturday April 10, 2021 @03:01PM (#26764063)
Ya, was thinking after I submitted that SELECT and DELETE are always going to be the longest anyway, so it always works for SQL!