For example, in Oracle, to calculate the rate at which orders were created on a specific date (e.g., July 4, 2011), you can issue the following query:
select substr(order_header_key,1,10) time, count(*) as count
from yfs_order_header
where order_header_key > '20110704000000' and
order_header_key < '20110704999999'
group by substr(order_header_key,1,10);
This query produces a listing like this:
TIME COUNT
------------------------ ----------
2011070406 3333
2011070407 3366
2011070408 3333
For DB2 to issue the query above at the uncommitted read lock level, issue the query with the "WITH UR" option:
select substr(order_header_key,1,10) time, count(*) as count
from yfs_order_header
where order_header_key > '20110704000000' and
order_header_key < '20110704999999'
group by substr(order_header_key,1,10)
with UR;