Stef Mientki <[EMAIL PROTECTED]> wrote:
Q1:
What's the difference between ON and WHERE,
the 2 statements below return exactly the same ?
<SQL-1>
SELECT Patient_text.*, Opnamen.*
FROM Patient as P
INNER JOIN Patient_text, Opnamen
ON P.PatNr = Patient_text.PatNr
WHERE P.PatNr = '00001'
</SQL-1>
<SQL-2>
SELECT Patient_text.*, Opnamen.*
FROM Patient
INNER JOIN Patient_text, Opnamen
WHERE Patient.PatNr = Patient_text.PatNr
AND Patient.PatNr = '00001'
</SQL-2>
These two queries are equivalent. The difference between ON and WHERE
becomes important when the query involves outer joins.
Q2:
Why isn't ALIAS supported in the JOIN-line, or am I doing something
wrong ? <SQL>
SELECT Patient_text.*, Opnamen.*
FROM Patient
INNER JOIN Patient_text, Opnamen AS O
WHERE Patient.PatNr = Patient_text.PatNr
AND Patient.PatNr = '00001'
</SQL>
What exactly do you believe is not supported? Do you get an error with
this statement? It looks good to me.
Q3:
In the SQL help on the web, I read:
"/join-op/ ::= *, *|* *[*NATURAL*]* *[*LEFT *|* RIGHT *|* FULL*]*
*[*OUTER *|* INNER *|* CROSS*]* JOIN*"
But when I try a RIGHT JOIN, I get an error message ???
SQLite doesn't support right outer joins at this time, only left joins.
By the way, SQL syntax supported by SQLite is documented here
http://www.sqlite.org/lang.html
And here are the limitations: http://www.sqlite.org/omitted.html
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------