2 Answers
- Newest
- Most votes
- Most comments
1
TO_NUMBER is not a function that works in Athena.
Rather use cast(value AS type)
or try_cast(value AS type)
.
For example try CAST(TO_CHAR(T1."INVOICE_DATE" ,'YYYY') AS int)
Reference: Please refer to Functions in Athena https://docs.aws.amazon.com/athena/latest/ug/presto-functions.html
answered 2 years ago
0
SELECT cast(TO_CHAR(T1."INVOICE_DATE" ,'YYYY')) "c1",
Error line 1:49: mismatched input ')'. Expecting: <expression>
answered 2 years ago
Relevant content
- Accepted Answerasked 6 months ago
- asked 6 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 9 months ago