Skip to content
Advertisement

SQL (Persons share the same birthday but they are exactly 100 years older or younger)

i have this table:

How do I fetch a list of Persons who have the same dob and exactly 100 years older or younger?

Expected rows:

The difference between dob should be 100 years

Advertisement

Answer

If the DOB is a date data type, would suggest using TRUNC and ADD_MONTHS.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement