Hacker News new | ask | show | jobs
by hn_throwaway_99 1902 days ago
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.
1 comments

Ya, was thinking after I submitted that SELECT and DELETE are always going to be the longest anyway, so it always works for SQL!