How to concatenate a value with a string

Asked

Viewed 64 times

0

Hello, I need to create a postgresql function that gets two ages and the function returns birth dates. I’m having difficulty calculating the date of birth, I’ve tried using interval and other commands like date to solve this problem.

1 answer

0


To decrease 48 years of a date:

select now() - 48 * interval '1 year';
           ?column?            
-------------------------------
 1968-10-07 20:46:38.699564+00

Note that there is no need to concatenate. Just multiply.

  • Thank you very much, it worked!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.