Hello I tried a few things, but I still can't find how to do this: The Companies table contains one row for each company; each row has a Code field that indicates the type of activity this company is into.
I'd like to count how many companies belong to each activity, and display the top ten. This only displays the last code + total number of rows in the table: SELECT code,COUNT(code) FROM companies ORDER by COUNT(code) DESC; This shows the same output: SELECT code,COUNT(code) FROM boites ORDER BY code DESC; Any idea how to do this? Thank you for any tip. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users