OracleのMONTHS_BETWEEN関数相当をPostgreSQLで実現
select extract(year from age * 12) + extract(month from age) as months_between from ( select age( clock_timestamp() ::timestamp , '2017-01-01 11:23:12' ::timestamp ) as age ) tbl;
select extract(year from age * 12) + extract(month from age) as months_between from ( select age( clock_timestamp() ::timestamp , '2017-01-01 11:23:12' ::timestamp ) as age ) tbl;