Unless I don't know SQL, the results look correct. Anyone chime in to
correct me. 

Your query:
select * from tst order by b, a desc;

Is really:
select * from tst order by b ASC, a desc;

So, if you look at the rows from top to bottom, you'll see that for each
value of 'b' in ascending order, you have the 'a' values in descending
order. 

Lee

___________________________________

-----Original Message-----
From: Ken [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 23, 2008 5: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




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

Reply via email to