K
K
kedavr132021-12-17 19:24:06
PostgreSQL
kedavr13, 2021-12-17 19:24:06

PostgreSQL how to select everyone whose birthday is February 16th?

There is a table with people, and a field with the date of birth. How can I select all people only by day and month without being tied to the year? That is, get everyone whose birthday is, say, February 16th.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akina, 2021-12-17
@Akina

SELECT *
FROM table
WHERE to_char(dob, 'MMDD') = '0216'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question