On Sep 28, 11:44 pm, russm <[email protected]> wrote: > in practice, there's no difference... from the postgres docs > (http://www.postgresql.org/docs/8.4/static/sql-select.html) - > > USING ( join_column [, ...] ) > A clause of the form USING ( a, b, ... ) is shorthand for ON > left_table.a = right_table.a AND left_table.b = right_table.b .... > Also, USING implies that only one of each pair of equivalent columns > will be included in the join output, not both. > > so in your example you'd only get a single "id" column in the output > rather than 1 from each of the employees and managers tables...
That's the really important part, since it allows for unqualified primary key lookups: SELECT * FROM employees INNER JOIN managers USING (id) WHERE (id = 1); -- WORKS SELECT * FROM employees INNER JOIN managers ON managers.id=employees.id WHERE (id = 1); -- ERROR Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
