[sqlite] Order by multiple columns

2016-02-25 Thread ad...@shuling.net
016 11:27 AM > To: SQLite mailing list > Subject: Re: [sqlite] Order by multiple columns > Importance: High > > > On 24 Feb 2016, at 3:15am, admin at shuling.net wrote: > > > CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER); > > > > Now if I want to s

[sqlite] Order by multiple columns

2016-02-25 Thread Simon Slavin
On 25 Feb 2016, at 2:31am, admin at shuling.net wrote: > Thank you. You're welcome. > In that case, if I create an index for (F1, F2, F3), then the > next time when I invoke SELECT statement like this: > > SELECT * FROM MyTable ORDER BY F1, F2, F3; > > Then SQLite will utilize the index autom

[sqlite] Order by multiple columns

2016-02-24 Thread ad...@shuling.net
Hi, I am using SQLite 3.11. I create a table as follows: CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER); Then add the following records: INSERT INTO MyTable (F1, F2, F3) Values (1, 2, 8);

[sqlite] Order by multiple columns

2016-02-24 Thread Simon Slavin
On 24 Feb 2016, at 3:15am, admin at shuling.net wrote: > CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER); > > Now if I want to select from MyTable, and sort the result based on F1 > (ascendant), and for two records with same F1, then sort based on > F2(ascendant), then sort based on F