oracle query data for today, yesterday, this week and this quarter

Oracle query all records for today, yesterday, this week, this month and this quarter
  1. Field type is date

Today
 select * from table name where to_char(field name,'dd')=to_char(sysdate,'dd')

yesterday

select * from table namewhere to_char(field name,'dd')= to_char(sysdate-1,'dd')
this week 
 select * from table namewhere to_char(field name,'iw')=to_char(sysdate,'iw ') 
this month 
 select * from table name where to_char(field name, 'mm')=to_char(sysdate, 'mm') 
this quarter 
 select * from table name where to_char(field name, 'q')=to_char(sysdate, 'q')

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324842655&siteId=291194637