I have a table like this:
id timestamp alive
1 2019-10-10 true
2 2019-10-10 false
... ......... .....
N 2021-01-01 boolean
What I need:
Extract by year and month how many true and false and the relation false/true the table has. Like this:
Period True False false/true
JAN-2019 1000 10 0.01
What I tried:
I did some cte using date_trunc but I got so many fails that I gave up.