我正在寻找一种在Postgresql中实现sqlServer函数datediff的方法。那是,
@H_301_6@datediff(dd,'2010-04-01','2012-03-05') = 704 // 704 changes of day in this interval datediff(mm,'2012-03-05') = 23 // 23 changes of month datediff(yy,'2012-03-05') = 2 // 2 changes of year
我知道我可以通过简单地使用减法来做’dd’,但是有关另外两个的想法呢?