How to write WHERE condition correctly in Query? | Community
Skip to main content
yuhuisg
New Participant
August 22, 2022
Solved

How to write WHERE condition correctly in Query?

  • August 22, 2022
  • 1 reply
  • 813 views

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.
Best answer by yuhuisg

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
yuhuisgAuthorAccepted solution
New Participant
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;