Re: [sqlite] Syntax for Counting Rows By Multiple Groups

2010-09-21 Thread Pavel Ivanov
>        sqlite> select sic, sic_desc, state, count(*) from Companies group by > sic; > The 'group by' phrase returns one row per group, which is what I want as > long as the group is a compound of industry number and state (the > description makes it easier to read and is fixed in association wit

Re: [sqlite] Syntax for Counting Rows By Multiple Groups

2010-09-21 Thread Igor Tandetnik
Rich Shepard wrote: > The closest I've come so far is: > sqlite> select sic, sic_desc, state, count(*) from Companies group by sic; > The 'group by' phrase returns one row per group, which is what I want as > long as the group is a compound of industry number and state Just throw more columns

[sqlite] Syntax for Counting Rows By Multiple Groups

2010-09-21 Thread Rich Shepard
I've a table with 15 columns, including industry number, industry description, and state. I'm trying to formulate the proper SELECT statement to return the count of rows for each industry number/description in each of the 5 states. I've looked at the aggregate function chapter in Rick van der La