[英]Extract Data as per Date Logic in Oracle SQL
我需要從 Oracle 數據庫中提取數據,這是業務需求:
需要關於 where 子句邏輯的幫助。
這不是一個答案。
那將是
select *
from your_table
where date_column =
case when to_char(sysdate, 'dy') in ('sun', 'mon') then next_day(trunc(sysdate) - 7, 'thu')
else trunc(sysdate) - 2
end;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.