News for hackers. Stuff that matters.
Re:Writing more legible SQL by Revell on Thursday November 03, 2016 @02:52AM (#12862049)
I write my SQL as follows:

    SELECT `second_column`,
           `fourth_column`
      FROM `table_name`
     WHERE `first_column` = 'Value'
       AND `third_column` = 3
  ORDER BY `fifth_column` ASC
     LIMIT 1
Re:Writing more legible SQL by 83457 on Thursday November 03, 2016 @04:54AM (#12862432)
Well that is cute. I find it odd that the second line of the where clause is on the same level as the where but a neat format otherwise. Tabs or spaces though?
Re:Writing more legible SQL by dfox on Thursday November 03, 2016 @04:40AM (#12862403)
What happens when you need to do something non-trivial? Ie. nested selects, joins or even only some more complex expression in WHERE?