Skip to content

CAST column AS SIGNED ? #37912

Answered by wakirin
wakirin asked this question in Q&A
Discussion options

You must be logged in to vote

https://stackoverflow.com/questions/72535044/clickhouse-cast-column-as-signed

SELECT
    arrayJoin(['+04:30', '-4:30', '10:00']) AS x,
    toInt64OrZero(extract(x, '(.*):')) AS y

Query id: 4b704281-649a-499e-906c-89873112c9e1

┌─x──────┬──y─┐
│ +04:30 │  4 │
│ -4:30  │ -4 │
│ 10:00  │ 10 │
└────────┴────┘

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by den-crane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant