drop schema if exists test_dayofweek;
create schema test_dayofweek;
set current_schema = test_dayofweek;
set time zone 'PRC';
show dolphin.sql_mode;
select current_timestamp;
select dayofweek('14:14:14');
select dayofweek(time'10:10:10');
select dayofweek('2022-01-01 00:00:00'::time);
select dayofweek('2022-06-28 00:00:00'::time) from dual;
select dayofweek(time('2022-06-28 00:00:00'));
select dayofweek(time'24:00:00');
select dayofweek(time'48:00:00');
select dayofweek(time'838:59:59');
create table t_timestamp(c timestamp);
create table t_datetime(c datetime);
insert into t_timestamp values('14:14:14');
insert ignore into t_timestamp values('14:14:14');
insert into t_datetime values('14:14:14');
insert ignore into t_datetime values('14:14:14');
select * from t_timestamp;
select * from t_datetime;
set dolphin.sql_mode = 'sql_mode_full_group,pipes_as_concat,ansi_quotes,no_zero_date,pad_char_to_full_length';
show dolphin.sql_mode;
select current_timestamp;
select dayofweek('14:14:14');
select dayofweek(time'10:10:10');
select dayofweek('2022-01-01 00:00:00'::time);
select dayofweek('2022-06-28 00:00:00'::time) from dual;
select dayofweek(time('2022-06-28 00:00:00'));
select dayofweek(time'24:00:00');
select dayofweek(time'48:00:00');
select dayofweek(time'838:59:59');
insert into t_timestamp values('14:14:14');
insert ignore into t_timestamp values('14:14:14');
insert into t_datetime values('14:14:14');
insert ignore into t_datetime values('14:14:14');
select * from t_timestamp;
select * from t_datetime;
set dolphin.b_compatibility_mode = true;
select dayofmonth('20:38:40');
select dayofmonth(time'20:38:40');
select dayofmonth(203840);
select dayofmonth(time'203840');
select dayofyear('20:38:40');
select dayofyear(time'20:38:40');
select dayofyear(203840);
select dayofyear(time'203840');
select quarter('20:38:40');
select quarter(time'20:38:40');
select quarter(203840);
select quarter(time'203840');
select day('10:10:10');
select day('2002-01-01 11:12:12'::time);
select dayofmonth('2002-01-01 11:12:12'::time);
select day('10:00:10');
select day('2002-00-01');
select day('2002-01-00');
create table t_day(c text);
insert into t_day values(day('2002-00-01'));
insert ignore into t_day values(day('2002-00-01'));
insert into t_day values(day('2002-01-00'));
insert ignore into t_day values(day('2002-01-00'));
select * from t_day;
drop table t_day;
reset current_schema;
drop schema if exists test_dayofweek cascade;