I have a table called Clientes
, and in it I have the following columns:
id_cliente
nm_cliente
dt_nascimento
I need to select and count all clients that were born in the same year. I already tried some things, but they do not return based on the same year, but on the same day, month and year.
My current query where it is not working looks like this:
SELECT dt_nascimento, count(*) FROM clientes
WHERE dt_nascimento = dt_nascimento
GROUP by dt_nascimento;
How can I select only based on the same year?