select to_char(to_date('2021-02-01','yyyy-mm-dd'),'d') rq from dual;
select to_char(sysdate,'d') rq from dual;
星期天为1,星期一为2,以当前月为例,不取周日,sql如下(oracle数据库):
select * from (
select to_char(to_date('2021-02','yyyy-mm')+level -1,'yyyy-mm-dd') rq from dual
connect by level<= to_number(to_char(last_day(to_date('2021-02','yyyy-mm')),'dd'))) t
where to_char(to_date(rq,'yyyy-mm-dd'),'d') <> 1;