Re: nested inner join help

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: nested inner join help
Дата
Msg-id web-601184@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на nested inner join help  ("Darryl M. Wolski" <drwolski@sympatico.ca>)
Ответы Re: nested inner join help  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Darryl,

In Postgres, neither the parentheses nor the word "INNER" are required.  Youwill significantly simplify your life if
youget rid of them, and clean upyour presentation of SQL text in order to debug your own joins.
 

One significant MSAccess <==> Postgres conflict is that Postgres assumes thatparens in the FROM clause represent
subselects(I think), while MS Access usesparens to organize JOINs.  Postgres behavior is, of course, more
SQL92correct.

SELECT orderlines.quantity, products.productname, products.productcost,customers.custlname,customers.custfname
FROM orders JOIN orderlines ON orders.orderid = orderlines.lnkorderid   JOIN customers ON customers.custid =
orders.lnkcustid  JOIN products ON products.productid = orderlines.lnkproductid
 
WHERE orders.orderid=2;

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


В списке pgsql-sql по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: CREATE TABLE glitch -fix request for 7.2
Следующее
От: pocm@rnl.ist.utl.pt (Paulo J. Matos)
Дата:
Сообщение: On delete cascade!