Good morning.
I wanted to make a select in my bank and return the number of registrations.
Example:
tb_client; column: dt_cadastro;
In the dt_cadastro column I have this:
2000-01-20
2001-10-05
1990-11-09
1990-07-16
1990-08-10
I wanted to do a select like this:
SELECT dt_cadastro, count(dt_cadastro)
FROM tb_cliente
WHERE dt_cadastro < 2000
GROUP BY dt_cadastro
I mean, I want to know how many are less than 2000 and I'm not getting it.
Following the suggestion of @Motta , I used this:
SELECT dt_cadastro , count(dt_cadastro )
FROM tb_cliente
WHERE Extract(year from dt_cadastro ) = Extract(year from '1990-12-31'::DATE)
GROUP BY dt_nasc
Only the result was:
"1990-01-01";1
"1990-08-02";1
"1990-08-08";1
I needed the 3 value to appear, is it possible?