Skip to content

Instantly share code, notes, and snippets.

@geoffb
Forked from isaacs/example.sql
Created April 7, 2010 05:57

Revisions

  1. geoffb revised this gist Apr 7, 2010. 1 changed file with 16 additions and 0 deletions.
    16 changes: 16 additions & 0 deletions example.sql
    Original file line number Diff line number Diff line change
    @@ -26,3 +26,19 @@ WHERE hurr
    AND (foo = 'bar')
    AND (bar = 'baz')
    LIMIT 1



    SELECT a.foo,
    a.bar,
    a.baz,
    b.foo,
    b.bar

    FROM table_a as a
    INNER JOIN table_b as b
    ON a.foo = b.foo

    WHERE a.bar = 1 AND b.bar = 2

    LIMIT 1
  2. isaacs revised this gist Apr 6, 2010. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion example.sql
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,13 @@ WHERE
    AND
    (foo = 'bar')
    LIMIT
    1
    1



    SELECT *
    FROM table
    WHERE hurr
    AND (foo = 'bar')
    AND (bar = 'baz')
    LIMIT 1
  3. richtaur created this gist Apr 6, 2010.
    19 changes: 19 additions & 0 deletions example.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    -- 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