268 lines
8.2 KiB
Plaintext
268 lines
8.2 KiB
Plaintext
|
|
taos> select WEEKOFYEAR('2020-01-01 00:00:00')
|
|
weekofyear('2020-01-01 00:00:00') |
|
|
====================================
|
|
1 |
|
|
|
|
taos> select WEEKOFYEAR('2020-01-01 00:00:00') from ts_4893.meters order by ts limit 10
|
|
weekofyear('2020-01-01 00:00:00') |
|
|
====================================
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
|
|
taos> select WEEKOFYEAR('2021-01-01 00:00:00')
|
|
weekofyear('2021-01-01 00:00:00') |
|
|
====================================
|
|
53 |
|
|
|
|
taos> select WEEKOFYEAR('2021-01-01 00:00:00') from ts_4893.meters order by ts limit 10
|
|
weekofyear('2021-01-01 00:00:00') |
|
|
====================================
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
|
|
taos> select WEEKOFYEAR('1998-01-01 00:00:00')
|
|
weekofyear('1998-01-01 00:00:00') |
|
|
====================================
|
|
1 |
|
|
|
|
taos> select WEEKOFYEAR('1998-01-01 00:00:00') from ts_4893.meters order by ts limit 10
|
|
weekofyear('1998-01-01 00:00:00') |
|
|
====================================
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
|
|
taos> select WEEKOFYEAR('1998-12-31 00:00:00')
|
|
weekofyear('1998-12-31 00:00:00') |
|
|
====================================
|
|
53 |
|
|
|
|
taos> select WEEKOFYEAR('1998-12-31 00:00:00') from ts_4893.meters order by ts limit 10
|
|
weekofyear('1998-12-31 00:00:00') |
|
|
====================================
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
53 |
|
|
|
|
taos> select WEEKOFYEAR('2000-01-06 00:00:00')
|
|
weekofyear('2000-01-06 00:00:00') |
|
|
====================================
|
|
1 |
|
|
|
|
taos> select WEEKOFYEAR('2000-01-06 00:00:00') from ts_4893.meters order by ts limit 10
|
|
weekofyear('2000-01-06 00:00:00') |
|
|
====================================
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
1 |
|
|
|
|
taos> select WEEKOFYEAR(1725095657)
|
|
weekofyear(1725095657) |
|
|
=========================
|
|
4 |
|
|
|
|
taos> select WEEKOFYEAR(1725095657) from ts_4893.meters order by ts limit 10
|
|
weekofyear(1725095657) |
|
|
=========================
|
|
4 |
|
|
4 |
|
|
4 |
|
|
4 |
|
|
4 |
|
|
4 |
|
|
4 |
|
|
4 |
|
|
4 |
|
|
4 |
|
|
|
|
taos> select WEEKOFYEAR(ts) from ts_4893.meters order by ts limit 10
|
|
weekofyear(ts) |
|
|
========================
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
|
|
taos> select weekofyear('2020-01-01')
|
|
weekofyear('2020-01-01') |
|
|
===========================
|
|
1 |
|
|
|
|
taos> select weekofyear(1721020666)
|
|
weekofyear(1721020666) |
|
|
=========================
|
|
4 |
|
|
|
|
taos> select weekofyear(1721020666229)
|
|
weekofyear(1721020666229) |
|
|
============================
|
|
29 |
|
|
|
|
taos> select weekofyear(ts) from ts_4893.d0 order by ts limit 10
|
|
weekofyear(ts) |
|
|
========================
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
|
|
taos> select weekofyear(ts) from ts_4893.meters order by ts limit 10
|
|
weekofyear(ts) |
|
|
========================
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
28 |
|
|
|
|
taos> select weekofyear(null)
|
|
weekofyear(null) |
|
|
========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('1721020591')
|
|
weekofyear('1721020591') |
|
|
===========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('1721020666229')
|
|
weekofyear('1721020666229') |
|
|
==============================
|
|
NULL |
|
|
|
|
taos> select weekofyear('abc')
|
|
weekofyear('abc') |
|
|
========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('01/01/2020')
|
|
weekofyear('01/01/2020') |
|
|
===========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('20200101')
|
|
weekofyear('20200101') |
|
|
=========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('20/01/01')
|
|
weekofyear('20/01/01') |
|
|
=========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('11/01/31')
|
|
weekofyear('11/01/31') |
|
|
=========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('01-JAN-20')
|
|
weekofyear('01-JAN-20') |
|
|
==========================
|
|
NULL |
|
|
|
|
taos> select weekofyear('2024-02-29')
|
|
weekofyear('2024-02-29') |
|
|
===========================
|
|
9 |
|
|
|
|
taos> select weekofyear('2024-01-01')
|
|
weekofyear('2024-01-01') |
|
|
===========================
|
|
1 |
|
|
|
|
taos> select weekofyear('2024-12-31')
|
|
weekofyear('2024-12-31') |
|
|
===========================
|
|
1 |
|
|
|
|
taos> select weekofyear('9999-12-31')
|
|
weekofyear('9999-12-31') |
|
|
===========================
|
|
52 |
|
|
|
|
taos> select weekofyear(name) from ts_4893.meters limit 1
|
|
weekofyear(name) |
|
|
========================
|
|
NULL |
|
|
|
|
taos> select weekofyear(ts) from ts_4893.meters limit 1
|
|
weekofyear(ts) |
|
|
========================
|
|
28 |
|
|
|
|
taos> select weekofyear(ts), dayofweek(ts) from ts_4893.meters limit 1
|
|
weekofyear(ts) | dayofweek(ts) |
|
|
================================================
|
|
28 | 6 |
|
|
|
|
taos> select weekofyear(timediff(ts, '2024-10-10 09:36:50.172')) from ts_4893.meters limit 1
|
|
weekofyear(timediff(ts, '2024-10-10 09:36:50.172')) |
|
|
======================================================
|
|
40 |
|
|
|
|
taos> select id, weekofyear(ts) from ts_4893.meters where id = 1 limit 1
|
|
id | weekofyear(ts) |
|
|
======================================
|
|
1 | 28 |
|
|
|
|
taos> select groupid, sum(weekofyear(ts)) from ts_4893.meters group by groupid order by groupid
|
|
groupid | sum(weekofyear(ts)) |
|
|
==================================
|
|
1 | 2720120 |
|
|
|