假设有一个表,预约日期为res_date,购买日期为buy_date
完成以下操作:
1。查询最近一周购买的图书
where buy_date bewteen trunc(sysdate-7) and sysdate;
2.查询本周日预购的图书
一.where res_date between trunc(next_date(sysdate,’sunday’)) and trunc(next_date(sysdate,’sunday’))+1;
二.where trunc (res_date)= trunc(next_date(sysdate,’sunday’));
3.查询最近一个月购买的图书
where buy_date bewteen runc(add_months(sysdate,-1)) and sysdate;
4.查询本周购买的图书
where buy_date between trunc(next_day(sysdate,’monday’))-7 and sysdate;