Time range average value

i have table like this:


score	year	month
----------------------
10	2000	01
12	2000	11
11	2001	02
15	2001	02
19	2001	02
14	2001	03
16	2002	01
11	2002	02

  • i want to get average score in range year 2000
  • i want to get average score in month 2001-02

what’s the true query?

also can i do it in sqlite, with sqlite 2 or sqlite 3 function?

SELECT AVG(score) FROM daTable WHERE year = 2000

SELECT AVG(score) FROM daTable WHERE year = 2001 AND month = 02

:slight_smile: