On 10/26/2016 10:53 AM, Jeff Archer wrote:
Hi and thanks in advance for your help.
I have a table of words and counts and I am trying to make a query which
sorts in descending order of count but with each group of words that have
the same count sorted alphabetically.
MY table:
CREATE TABLE words
(id INTEGER PRIMARY KEY AUTOINCREMENT
,cnt INTEGER DEFAULT 1
,rvw INTEGER DEFAULT 0
,txt TEXT UNIQUE);
sqlite> select txt, cnt, rvw from words where txt!="" and rvw!=0 order by
cnt desc;
Just do " order by cnt desc, txt "
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users