从今天开始最近7天(1周)内如何从DB2中获取记录 [英] How to fetch records from DB2 for the last 7 days (1 WEEK) from today
本文介绍了从今天开始最近7天(1周)内如何从DB2中获取记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用DB2。我想从一列中获取本周的记录。我想使用类似以下的内容(这是针对SQL 2005的)
I am using DB2. I want to fetch records for this week from a column. I want to use similar to below (This is for SQL 2005)
Select count(*) from Applications WHERE ReceivedDate is this week. (Last 7 days including today)
推荐答案
尝试WHERE子句像这样:
Try a WHERE clause like this:
WHERE ReceivedDate > current date - 7 days
这篇关于从今天开始最近7天(1周)内如何从DB2中获取记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文