error on BQ No matching signature for operator AND for argument types: BOOL, STRING. Supported signature: BOOL AND

311 views Asked by At

I am trying to retrieve data from two specific locations on BQ and getting this error: No matching signature for operator AND for argument types: BOOL, STRING. Supported signature: BOOL AND

I am guessing the query is matching two separate data type and I have to peform a CAST function. But how do I write the query to receive the desired output? This Big Query is highlighting on "Bangladesh" so I am thinking I might need to change the datatype on that.

Below is my code:

SELECT location, date, total_cases, total_deaths,population, (total_cases/population)*100 as death_percentage
FROM `my-project-72222022.PortfolioProject.CovidDeaths` 
WHERE location = "Bangladesh" AND "United States"
ORDER BY 1, 2
LIMIT 1000

Thank you in advance!

1

There are 1 answers

0
NickW On

If you want to match multiple values you need to use IN or have multiple clauses in your WHERE statement e.g.

WHERE location IN ("Bangladesh", "United States")

WHERE location = "Bangladesh" 
OR location = "United States"