Igor,

I was able to run the query with just a sub-select alias and no column
aliases.  No error on the duplicated PatNr column from the inner select *.
I agree that I would expect sqlite to produce some kind of ambiguous column
name error or something but didn't get one.

Best regards,

Sam


-------------------------------------------
We're Hiring! Seeking a passionate developer to join our team building
products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 
-----Original Message-----
From: Igor Tandetnik [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 09, 2007 5:48 PM
To: SQLite
Subject: [sqlite] Re: are nested joins possible ?

SELECT *
  FROM Patient_Text
  INNER JOIN
  (
SELECT *
  FROM Patient
  INNER JOIN Opnamen
  ON Patient.PatNr = Opnamen.PatNr
  ) AS Patient
  ON Patient.PatNr = Patient_Text.PatNr

However, in this particular case you'll have a problem, since the result 
of subselect contains two columns named PatNr (one from Patient and one 
from Opnamen). So Patient.PatNr will be ambiguous. You could explicitly 
name columns in the subselect and give them aliases, then refer to them 
as SubselectAlias.ColumnAlias. But this way you won't be able to use * 
notation.

Igor Tandetnik 



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to