Given an SQLite database with three columns (char, char, int), the following query
select column2, avg(column3) from table_name group by column2;
will return the average values of column3
aggregate for each distinct value of column2
.
What will the following query return?
select column1, column2, avg(column3) from table_name group by column2;
I came across this case while playing with Codeacademy's SQL tutorial. This particular query returns a value of column1
for each distinct value of column2
, but I can't figure out how these values were chosen.