Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - SQL 参考 » 使用 SQL » SQL 函数 » SQL 函数 (A-D)

 

DOW 函数 [Date and time]

返回 1 到 7 之间的一个数字,表示某个日期是星期几,其中 1 表示星期日,2 表示星期一,依此类推。

语法
DOW( date-expression )
参数
  • date-expression   要计算的日期。

返回值

SMALLINT

注释

DOW 函数不受为 first_day_of_week 数据库选项指定的值的影响。例如,即使将 first_day_of_week 设置为 Monday,对于 Monday,DOW 函数仍会返回 2。

标准和兼容性
  • SQL/2003   服务商扩充。

示例

以下语句返回值 5。

SELECT DOW( '1998-07-09' );

以下语句查询 Employees 表,然后返回雇员的 StartDate,以与星期几对应的数字表示:

SELECT DOW( StartDate ) FROM Employees;