Produit : 4D ODBC Driver 2004 · Plateforme : Mac & Win ♪
En essayant d'exécuter la requête suivante via le driver ODBC, pour lire le contenu des tables 4D vers MS Query, une erreur de syntaxe est retournée.
SELECT
titles.title_id, titles.title, sales.qty, sales.price
FROM
titles
RIGHT
OUTER
JOIN
sales
ON
titles.title_id=
sales.title_id
En fait, les commandes "RIGHT OUTER JOIN " et "LEFT OUTER JOIN" sont des commandes ANSI.
Voir la documentation suivante (dont suit un extrait):
http://www4.dogus.edu.tr/bim/bil_kay/dbase/mssql65/ch11.htm#Heading12
---------------------
Outer Joins
You can restrict rows from one table while allowing all rows from another table as
your result set by using outer joins. One of the most common uses for this type of
join is to search for orphan records. You can create an outer join statement using
either SQL Server or ANSI syntax. The outer join operators and keywords are as follows:
SQL Server syntax:
>*= Includes all rows from the first table and only the matching rows in the second
table (left outer join).
>=* Includes all rows from the second table and only the matching rows in the first
table (right outer join).
ANSI syntax:
LEFT OUTER JOIN Includes all rows from the first table and only the matching rows
in the second table.
RIGHT OUTER JOIN Includes all rows from the second table and only the matching rows
in the first table.
FULL OUTER JOIN Includes all non-matching rows from both tables.
---------------------
Donc, la syntaxe SQL doit être :
Pour un RIGHT OUTER JOIN
SELECT
titles.Title_id, titles.Title, sales.qty, sales.Price
FROM
sales, titles
WHERE
titles.Title_id =*
sales.Title_id
Pour un LEFT OUTER JOIN
SELECT
titles.Title_id, titles.Title, sales.qty, sales.Price
FROM
sales, titles
WHERE
titles.Title_id *=
sales.Title_id