description |
---|
Returns the day of the week (from 1 to 7) of the date or timestamp. |
- date_timestamp_expression: A
DATE
orTIMESTAMP
expression.
Examples
{% code title="DAYOFWEEK example" %}
SELECT DAYOFWEEK(DATE '2021-02-28')
-- 1
{% endcode %}
{% code title="DAYOFWEEK example" %}
SELECT DAYOFWEEK(TIMESTAMP '2021-02-27 11:43:22')
-- 7
{% endcode %}