select sum(case when creationDate between '2022-01-01' an...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select 
sum(case when creationDate between '2022-01-01' and '2022-08-29' then 1 else 0 end) as cnt_2022,
sum(case when creationDate between '2023-01-01' and '2023-08-29' then 1 else 0 end) as cnt_2023
from posts

Enter Parameters

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