DATEDIFF in DB2 query
问题 I have a query from mysql that has been running on a table I recently migrated to DB2. The query now fails on DB2 due to the line below, saying that DATEDIFF cannot be found. I'm assuming only because this isn't a valid function on db2. Is there an equivalent to this on DB2 that will maintain performance as well as function? SELECT DISTINCT LEAST(180, DATEDIFF(curdate(), start_date)) as days FROM table2 where expire_date > curdate() 回答1: I use the DAYS() function to convert the dates to