Geopt Proud Member
Mensagens: 30152
Registado: domingo 25 abr 2010, 01:07
Localização: Lisboa
Re: IAAN - Balanço Ano N / Previsões Ano N+1
- Código:
select substr(publish, 1, 4) as ano, count(*) as caches, count(distinct(ownerid)) as owners from caches a1, custom a2 where ccode=code and cachetype in ('C','D','E','F','Z') and not exists
(select '1' from caches a3, custom a4 where ccode=code and cachetype in ('C','D','E','F','Z') and a3.ownerid=a1.ownerid and substr(a4.publish, 1, 4) < substr(a2.publish, 1, 4) )
group by ano order by ano desc
2023 4 4
2022 138 111
2021 46 27
2020 33 26
2019 192 140
2018 287 147
2017 209 118
2016 212 126
2015 234 167
2014 289 163
2013 363 151
2012 197 117
2011 124 84
2010 65 46
2009 44 29
2008 39 27
2007 14 12
2006 14 8
2005 4 4
2004 1 1
2003 2 2
2002 1 1