How to concatenate a value with a string

0

Hello, I need to create a function in postgresql that gets two ages and the function returns the dates of birth. I am having difficulty calculating the date of birth, I have already tried using interval and other date type commands to solve this problem.

    
asked by anonymous 07.10.2016 / 18:27

1 answer

0

To shorten 48 years of a date:

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

See that you do not need to do concatenation. Just multiply.

    
07.10.2016 / 22:48