News for hackers. Stuff that matters.
Re:Best practices for writing SQL queries by thih9 on Saturday April 10, 2021 @01:41PM (#26763344)
Maintaining alignment in these queries seems a pain. I'd prefer the regular, newlines and fixed indentation; e.g.:

    SELECT a.foo, b.bar, g.zed
    FROM alpha a
    JOIN beta b ON a.id = b.alpha_id AND a.another = b.thing
      LEFT JOIN gamma g ON b.id = g.beta_id 
    WHERE a.val > 1
      AND b.col < 2
    ORDER BY a.foo
(bonus: "AND" got accidentally aligned with the end of "WHERE")
Re:Best practices for writing SQL queries by akira2501 on Saturday April 10, 2021 @02:36PM (#26763812)
> Maintaining alignment in these queries seems a pain.

I use tabs.

    SELECT   t.foo, t.bar
    FROM     a_table t
Re:Best practices for writing SQL queries by zikzak on Saturday April 10, 2021 @04:36PM (#26764913)
This escalated quickly.