java - i need to group years and select last five years with the averages of each year so that i have average and year output -
i need group years , select last 5 years averages of each year have average , year output
select ap, yr ( select year yr, avg( "tbltest.askingprice" ) ap tbltest group `yr` desc limit 5 )sub group `yr` asc
select sub.yr, sub.ap ( select year yr, avg(askingprice) ap tbltest group yr order yr desc limit 0,5 ) sub order sub.yr asc
Comments
Post a Comment