RE: [sqlite] ORDER BY of UNION?

2006-03-02 Thread Boris Popov
- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 1:52 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] ORDER BY of UNION? Boris Popov wrote: >Looks like I'm on my own with this one :) > >After a bit of fiddling with it this morning, I figured I had to do this

Re: [sqlite] ORDER BY of UNION?

2006-03-02 Thread Dennis Cote
Boris Popov wrote: Looks like I'm on my own with this one :) After a bit of fiddling with it this morning, I figured I had to do this SELECT DISTINCT * FROM (SELECT t1.ID FROM GR_ADDRESS t1 WHERE t1.ID > 1 UNION ALL SELECT t1.ID FROM PERSON t1 ORDER BY t1.ID DESC) instead of SELECT

RE: [sqlite] ORDER BY of UNION?

2006-03-02 Thread Boris Popov
-users@sqlite.org Subject: RE: [sqlite] ORDER BY of UNION? Okay that works, but is there a way to make it work with the t1 alias? I'm porting an existing application to SQLite and changing all queries to not use aliases may be problematic if you know what I mean. Looking at the syntax page I don't see how

RE: [sqlite] ORDER BY of UNION?

2006-03-01 Thread Boris Popov
10:19 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] ORDER BY of UNION? At 8:59 PM -0800 3/1/06, Boris Popov wrote: >I can't seem to get unions to sort properly, > >SELECT DISTINCT * FROM (SELECT t1.ID >FROM GR_ADDRESS t1 UNION ALL SELECT t1.ID >FROM PERSON t1) t1 ORDE

Re: [sqlite] ORDER BY of UNION?

2006-03-01 Thread Darren Duncan
At 8:59 PM -0800 3/1/06, Boris Popov wrote: I can't seem to get unions to sort properly, SELECT DISTINCT * FROM (SELECT t1.ID FROM GR_ADDRESS t1 UNION ALL SELECT t1.ID FROM PERSON t1) t1 ORDER BY t1.ID DESC results in "no such column: t1.ID" error. How would I go about sorting the result set

[sqlite] ORDER BY of UNION?

2006-03-01 Thread Boris Popov
I can't seem to get unions to sort properly, SELECT DISTINCT * FROM (SELECT t1.ID FROM GR_ADDRESS t1 UNION ALL SELECT t1.ID FROM PERSON t1) t1 ORDER BY t1.ID DESC results in "no such column: t1.ID" error. How would I go about sorting the result set in this case? Cheers! -Boris --