Abbreviation of Month Name in formatDateTime

15 views
Skip to first unread message

Mai Abdel-Qader

unread,
Jan 13, 2020, 5:28:58 AM1/13/20
to ClickHouse
Hello,

How can I get the abbreviation of month name (e.g: Jan, Feb, .. etc) using formatDateTime?


Thanks a lot,
Mai

Denis Zhuravlev

unread,
Jan 13, 2020, 10:05:43 AM1/13/20
to ClickHouse
No. You cannot.


only manually
WITH
    (
        SELECT ['Jan', 'Feb', 'Mar', 'Apr']
    ) AS m
SELECT
    d,
    m[d]
FROM
(
    SELECT 4 AS d
    UNION ALL
    SELECT 1
)

┌─d─┬─arrayElement(m, d)─┐
│ 1 │ Jan                │
└───┴────────────────────┘
┌─d─┬─arrayElement(m, d)─┐
│ 4 │ Apr                │
└───┴────────────────────┘

Reply all
Reply to author
Forward
0 new messages