mysql - 在存储过程中获取一周中的天数

标签 mysql datetime stored-procedures

如何获取一周中的某一天,例如:

2009-10-21 would be 4 assuming that:

Sun - 1
Mon - 2
Tue - 3
Wed - 4
Thu - 5
Fri - 6
Sat - 7

我使用的是MySql Server 5.0.37

最佳答案

选择 DAYOFWEEK ('2009-10-13')

关于mysql - 在存储过程中获取一周中的天数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1604043/

相关文章:

php 不向表中插入任何内容

SQL - 仅更新日期()数据

datetime - 在 Cassandra 中使用日期

asp.net - LINQ、存储过程、内联查询

mysql - SQL : Inner or Outer Join to delete rows from databases?

mysql - 如何备份 MySQL 数据库?

php - 微分变量等于 0,变量等于空数组 ['column']

c# - 如何将 Datetime 中英文文本中的月份名称转换为 C# 中的阿拉伯文本?

mysql - 从 MYSQL 上的 DATA 文件夹恢复函数和存储过程

mysql - 处理级联删除: Are there ways to do this automatically in mySQL