Trouble joining and filtering data in SQLite -


i having trouble performing query. first, .schema:

create table cities (name text, state text); create table weather (city text, year int, warm_month text, cold_month text, average_high int); 

i have table of city name / state values, , weather table columns listed above. need query find mean of average high temperatures of cities within state.

my query follows:

select city, avg(average_high) weather   ...> inner join cities   ...> on name = city   ...> group state; 

this displays correct average each state, displays city name rather state name. know ask city in select statement, , never select state anywhere... guess need additional select statement don't know syntax.

what

select state, avg(average_high)


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -