create table #e ( [year] int, [avg] int ); insert into #e...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Woodworking

Q&A for professional and amateur woodworkers

create table #e (
    [year] int,
    [avg] int
);
insert into #e ([year], [avg])
values (
    2016,
    (
        select avg(score) from posts where year(creationdate) = 2016
    )
);
insert into #e ([year], [avg])
values (
    2017,
    (
        select avg(score) from posts where year(creationdate) = 2017
    )
);
select * from #e;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results