problem with SQL query in DB2
问题 How can i write a query in DB2 for following thing: The difference between current timestamp and a timestamp field in dB should be >=4 hours AND <= 24 hours 回答1: You don't really give enough information to answer the question (i.e., do you want data only from the past, only in the future, etc), but let's assume you want the data where the timestamp column ("tscolumn") is more than 4 hours old and less than 24 hours old: select * from table t where t.tscolumn between current timestamp - 4