James thats indeed the result expected. I'll add the additional desc. I errantly assumed the desc applied to both columns and the the entire result would be ordered desc. But I see now the error of my ways.
Thanks, Ken James Dennett <[EMAIL PROTECTED]> wrote: > -----Original Message----- > From: Ken [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 23, 2008 4:10 PM > To: sqlite > Subject: [sqlite] order by issue? > > I'm not sure if this a bug or if working as intended: > > the order by b,a seems to cause B to use asc.. Instead of the desc as > written in the order by statement. > > create table tst (a integer, b integer ); > sqlite> insert into tst values(1,1); > sqlite> insert into tst values(1,2); > sqlite> insert into tst values(1,3); > sqlite> insert into tst values(2,3); > sqlite> insert into tst values(2,2); > sqlite> insert into tst values(2,1); > sqlite> select * from tst order by b, a desc; > a|b > 2|1 > 1|1 > 2|2 > 1|2 > 2|3 > 1|3 Could be that I'm too tired again, but that looks to me like you asked for order primarily by b (with the default, ascending, order) and secondarily by a (with inverted/descending order). select * from tst order by b desc, a desc; might be what you were wanting? -- James