how to calculate only days between two dates in postgres sql query .
问题 Suppose I have given two dates, if difference is one month then it should be display as 30 days.Even months also need to convert into days I have tried with age( date,now()::timestamp without time zone) but it is giving months-dates-years format. ex: 10 mons 24 days 13:57:40.5265.But I need following way. For example if two months difference is there then I need output as 60 days. 回答1: Don't use the age() function for date/time arithmetic. It only returns "symbolic" results (which are good