Skip to content

Instantly share code, notes, and snippets.

@isaacs
Forked from richtaur/example.sql
Created April 6, 2010 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save isaacs/358008 to your computer and use it in GitHub Desktop.
Save isaacs/358008 to your computer and use it in GitHub Desktop.
-- I used to do it like this:
SELECT * FROM table WHERE
hurr
AND (foo = 'bar')
AND (bar = 'foo')
-- Then later I spaced it out even more:
SELECT
*
FROM
table
WHERE
hurr
AND
(foo = 'bar')
LIMIT
1
SELECT *
FROM table
WHERE hurr
AND (foo = 'bar')
AND (bar = 'baz')
LIMIT 1
@mozillalives
Copy link

I've always preferred the final one - much easier to mentally parse the statement and thereby figure out what it's attempting to achieve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment