Ah, I overlooked that and just assumed it was correct since sqlite accepted it. Thanks for your help!
The reason we need this is that we're procedurally generating SQL queries, and it's easier to insert parentheses everywhere than just in the (very) few join clauses where they are actually needed. Thanks again! Luke On Monday, April 29, 2013 at 00:08, James K. Lowden wrote: > On Sun, 28 Apr 2013 12:23:42 +0200 > Lucas Clemente <[email protected] (mailto:[email protected])> > wrote: > > > SELECT * FROM (t1 AS a) JOIN (t2 AS b) USING(k) WHERE a.k = 1; > ... > > Looks like this is due to some problem with resolving the alias in > > the parantheses. Now, as far as I understand SQL this should just > > work since the () don't introduce a new scope. > > > > > http://www.sqlite.org/lang_select.html > http://www.sqlite.org/syntaxdiagrams.html#single-source > > As far as I can tell, the syntax you're using is invalid. If it's a > bug, it's not a failure to interpret your SQL correctly, but a failure > to report the error. > > The "single-source" section of the selection statement allows > parentheses around a join-source or around a single-source. In either > case, the closing parenthesis must appear before the AS keyword. > > May I ask why you're using these parentheses in the first place? > I have never felt the need to use parentheses in SQL except to control > arithmetic or boolean precedence. > > --jkl > _______________________________________________ > sqlite-users mailing list > [email protected] (mailto:[email protected]) > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

