Hi,

I get the following error with SQLite 3.6.1

"1st ORDER BY term does not match any column in the result set"

>From the following query
"SELECT id,  url,  selected, FROM db1.test  UNION 
SELECT id,  url,  selected, FROM db2.test  
ORDER BY name ASC, id DESC LIMIT 100"

However the equivalent with a single DB i.e. without the UNION seems to work
fine. 

Is there a general restriction that ORDER BY terms must be in the result
set? And if so why doesn't it kick in without the UNION?

And is there a performance cost to adding the ORDER term to the result set,
given that we are ordering by it anyway?

Many thanks,
Tom


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

Reply via email to