SYNTAX_ERROR: line 7:30: '=' cannot be applied to decimal(4,0), varchar(4)

0

The following line is where the problem is: where MATERIAL_DOCUMENT_YEAR = '2021' SYNTAX_ERROR: line 7:30: '=' cannot be applied to decimal(4,0), varchar(4) This query ran against the "us_aftersales_atlas_pre" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 08249017-ee19-4f2d-9b9c-4cdfe80d8d98

asked a year ago268 views
1 Answer
0

Hello,

In Athena, values enclosed within single quotes represent string values. I checked through table details and could see column 'MATERIAL_DOCUMENT_YEAR' is defined as decimal(4,0) and thus the error.

To fix this, you can consider any one of the below approaches:

where MATERIAL_DOCUMENT_YEAR = 2021

Or

where MATERIAL_DOCUMENT_YEAR = decimal '2021'
AWS
SUPPORT ENGINEER
Nitin_S
answered a year ago
AWS
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions