I want to count the number of months between two dates.
Doing :
SELECT TIMESTAMP \'2012-06-13 10:38:40\' - TIMESTAMP \'2011-04-30 14:38:40\';
Try this solution:
SELECT extract (MONTH FROM age('2014-03-03 00:00:00'::timestamp, '2013-02-03 00:00:00'::timestamp)) + 12 * extract (YEAR FROM age('2014-03-03 00:00:00'::timestamp, '2013-02-03 00:00:00'::timestamp)) as age_in_month;