---
title: "oracle返回星期几的函数"
author: "小丑鱼0703"
date: "2012-08-30T17:29:32Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2012-08-31T11:07:05Z"
id: 1668134
url: "https://wangjingyi.iteye.com/blog/1668134"
---

做报表时遇到需求滚动展示周数据，除掉周六和周天的数值，简单记录下。

在sql语句where条件中添加：to\_char(d1.d\_day,'d')not in(1,7)--去掉周六周日两天

现有时间维表d\_timeday,执行sql：

select * from d\_timeday d where to\_char(d.d\_day,'d') not in(1,7)

实现效果：