Expand my Community achievements bar.

SOLVED

How to write WHERE condition correctly in Query?

Avatar

Community Advisor

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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;

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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;