Skip to main content
yuhuisg
Community Advisor
Community Advisor
August 22, 2022
Solved

How to write WHERE condition correctly in Query?

Why do these queries throw the same error in Queries?

SELECT * FROM table
WHERE table.eventType LIKE "purchases"
LIMIT 10;
SELECT * FROM table
WHERE table.eventType = "commerce.purchases"
LIMIT 10;

Error:

ErrorCode: 08P01 Unknown error encountered. Reason: [Column 'commerce.purchases' does not exist. Did you mean one of the following? [... list of table column names ...]; ...] abfss://gen1@sndbxsomethingsomething.dfs.core.windows.net/platform/alphanumericID

 

Yet when I run "SELECT * FROM table;" I can clearly see "commerce.purchases" in the "eventType" column.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
yuhuisg
yuhuisgAccepted solution
Community Advisor
August 22, 2022

Never mind, I figured it out. I should be using single quotes instead of double quotes.

So this returned a result properly:

SELECT * FROM table
WHERE table.eventType = 'commerce.purchases'
LIMIT 10;

1 reply

yuhuisg
Community Advisor
yuhuisgCommunity AdvisorAuthorAccepted solution
Community Advisor
August 22, 2022

Never mind, I figured it out. I should be using single quotes instead of double quotes.

So this returned a result properly:

SELECT * FROM table
WHERE table.eventType = 'commerce.purchases'
LIMIT 10;
Translate