WEEKDAY()

Description

This function returns the weekday index for date (0 = Monday, 1 = Tuesday, … 6 = Sunday).

Syntax

  1. > WEEKDAY(date)

Arguments

ArgumentsDescription
dateRequired.

Examples

  1. > drop table if exists t1;
  2. > create table t1(a date,b datetime);
  3. > insert into t1 values('20220202','2021-12-24 09:23:23');
  4. > insert into t1 values('2022-02-02','2021-12-24');
  5. > select weekday(a),weekday(b) from t1;
  6. +------------+------------+
  7. | weekday(a) | weekday(b) |
  8. +------------+------------+
  9. | 2 | 4 |
  10. | 2 | 4 |
  11. +------------+------------+

Constraints

The date type supports only yyyy-mm-dd and yyyymmdd for now.

Currently, MatrixOne doesn’t support select function() without from tables.