Still, I think backwards compatibility and consistency with other databases
would be most important in this situation.  I just checked MSSQL and it's
same as current sqlite which uses the first select statement's column names.

It doesn't just affect order by too.. based on the standard SQLite should be
returning a different column name entirely in the result set.  Surely it
would break a lot of code out there if SQLite suddenly started returning
seemingly random column names from union queries when the query didn't
specifically alias the columns.

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: Dennis Cote [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 12, 2007 11:09 PM
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Help with SQL syntax. Ticket #2296

On 4/12/07, Samuel R. Neff <[EMAIL PROTECTED]> wrote:
>
>
> Wouldn't implementation dependent mean it's not really standardized?  The
> way I read it the query could still be considered legal in some dbms and
> not
> in others (which stinks).


Samuel,

That's not what the standard says. It says the name assigned to the result
columns are implementation dependent, they could be sqlite_column_1 and
sqlite_column_2, or perhaps cnnnnnnn where nnnnnnn is a random number, but
they can not be the names of any of the columns in any of the tables in the
query. The query should generate a syntax error because it is trying to sort
on columns that are not, or at least should not be, present in the result.


Besides, the current version of SQLite seems to match on the first tables
> names which is consistent with expectations from other databases and not
> prohibited by the standard (in the way I read it) and backwards
> compatibility seems to be the most important thing here..
>
>
This behavior is prohibited by the standard.

Dennis Cote


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

Reply via email to