Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit be1f7a1

Browse files
authored
Merge pull request #671 from mcuadros/dayofmonth-func
sql/expression: new dayofmonth function (alias of day)
2 parents d9a12ff + e369e66 commit be1f7a1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ We support and actively test against certain third-party clients to ensure compa
6868
|`CONCAT_WS(sep, ...)`|Concatenate any group of fields into a single string. The first argument is the separator for the rest of the arguments. The separator is added between the strings to be concatenated. The separator can be a string, as can the rest of the arguments. If the separator is NULL, the result is NULL.|
6969
|`CONNECTION_ID()`|Return the current connection ID.|
7070
|`COUNT(expr)`| Returns a count of the number of non-NULL values of expr in the rows retrieved by a SELECT statement.|
71-
|`DAY(date)`|Returns the day of the given date.|
71+
|`DAY(date)`|Synonym for DAYOFMONTH().|
72+
|`DAYOFMONTH(date)`|Return the day of the month (0-31).|
7273
|`DAYOFWEEK(date)`|Returns the day of the week of the given date.|
7374
|`DAYOFYEAR(date)`|Returns the day of the year of the given date.|
7475
|`FLOOR(number)`|Return the largest integer value that is less than or equal to `number`.|

sql/expression/function/registry.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var Defaults = []sql.Function{
4141
sql.Function1{Name: "minute", Fn: NewMinute},
4242
sql.Function1{Name: "second", Fn: NewSecond},
4343
sql.Function1{Name: "dayofweek", Fn: NewDayOfWeek},
44+
sql.Function1{Name: "dayofmonth", Fn: NewDay},
4445
sql.Function1{Name: "dayofyear", Fn: NewDayOfYear},
4546
sql.FunctionN{Name: "yearweek", Fn: NewYearWeek},
4647
sql.Function1{Name: "array_length", Fn: NewArrayLength},

0 commit comments

Comments
 (0)