Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
"Where clause" is not working in AWS Athena

data sample

I used AWS Glue Console to create a table from S3 bucket in Athena. You can see a relevant part on the screenshot above. I obfuscated column name, so assume the column name is "a test column". I would like to select the records with value D in that column. The query I tried to run is:

SELECT 
    * 
FROM 
    table 
WHERE 
    "a test column" = "D"

Nothing is returned. I also tried to use IS instead of =, as well as to surround D with single quotes instead of double quotes within the WHERE clause:

-- Tried this
WHERE 
    "a test column" = 'D'

-- Tried this
WHERE 
    "a test column" IS "D"

-- Tried this
WHERE 
    "a test column" IS 'D'

Nothing works. Can someone help? Thank you.

The error message I got is

Mismatched input 'where' expecting (service: amazon athena; status code: 400; error code: invalid request exception; request id: 8f2f7c17-8832-4e34-8fb2-a78855e3c17d)

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Problem with the query syntax. Use single quotes (') when you refer to a string values, because double quotes refer to a column name in your table.

SELECT 
    * 
FROM 
    table 
WHERE 
    "column_name" = 'D'
over 4 years ago · Santiago Trujillo Report

0

The unexpected answer (also apologize if I did not say it clearly in the original post) is that, I cannot add "limit 200" in front of the where clause. I have to add it in the end. Hope it helps others.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!