ORACLE using statement query data (not including Saturday, Sunday) three days before the query data in three days if including weekends, add a day or two, and the corresponding Example 1: what day is it today 1 last week, so I need to check the data is on Saturday, Sunday, Friday, Thursday, Wednesday's data; Example 2: if data query to week 5 Thursday today, Wednesday, Tuesday's data; Here is not a single query
CodePudding user response:
Select * from t1 where trunc (rq) & gt; (select case to_char (sysdate, 'd') When (2 and 4) then in trunc (sysdate + 5) When in (5, 6) then trunc (sysdate + 3) When in (1) then trunc (sysdate + 4) End the from dual)
CodePudding user response:
Idea is to use to_char (sysdate, 'd') takes the current is how many days this week, the weekend for the first day of the beginning
CodePudding user response:
Today is a few, decode, enumeration carted back again for several days,