[thelist] MS Table Join Question (from Excel)

r937 rudy at r937.com
Thu May 12 04:31:52 CDT 2011


> Didn't know about that "on" splifflety goodness.

it's standard sql (comma style joins with the join conditions in the WHERE 
clause are deprecated)

  SELECT stuff
    FROM table_1 AS al1
  INNER
    JOIN table_2 AS al2
      ON al2.sku = al1.part
  INNER
    JOIN table_3 AS al3
      ON al3.code = al1.code
  LEFT OUTER
    JOIN customer AS al4
      ON al4.customer_number = al1.customer_number
   WHERE other_conditions

couple tips:

- don't ( use ( parentheses )) needlessly

- put your inner joins ahead of the outer joins


--
rudy
http://r937.com/





More information about the thelist mailing list