2
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 customers who were born in the same year. I have tried some things, but they do not return on the basis of the same year but of the same day, month and year.
My current query that is not working is 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 ?
Hello, thank you so much for the reply. It seems to work but is returning to me that I am missing an expression.
– Monteiro
Strange, for both he said they are invalid formats. Why is this happening ?
– Monteiro
It worked right now, +1 and right answer. Thank you for your patience in correcting the answer.
– Monteiro