On Wed, Aug 14, 2013 at 2:18 PM, Marc L. Allen
<mlal...@outsitenetworks.com>wrote:

> Heh... I forgot.. both selects below are identical, as 'lower(m1)' is
> incorrect.  MS SQL does not permit further operations on the derived value.
>

I think you also missed the name ambiguity issue.  The queries are these:

SELECT '1', substr(m,2) AS m
  FROM t1
 ORDER BY m;

SELECT '2', substr(m,2) AS m
  FROM t1
 ORDER BY lower(m);

Notice that the "m" in the ORDER BY clause might refer to column t1.m or it
might refer to the result set column labeled "AS m".  The question is which
one.  PostgreSQL answers t1.m for the first case and "AS m" for the
second.  SQLite used to do that, but now it answers "t1.m" in both cases,
which seems to be a better fit to the SQL standard that Peter reports.

Marc, if you can also try the query below on SQL Server, that would be most
helpful:

SELECT '3', substr(m,2) AS m
  FROM t1
 ORDER BY m COLLATE Latin1_General_CS_AS;


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to