본문 바로가기

work/oracle

요일쿼리

select decode(next_day(to_date(logdate,'yyyy-mm-dd' ), 7)-to_date(logdate, 'yyyy-mm-dd'), 6,'일',5,'월',4,'화',3,'수',2,'목',1,'금',7,'토',0,'토')
from fwserv