Select to view content in your preferred language

How to filter out features with WHERE clause

715
3
Jump to solution
11-17-2021 11:27 AM
REDARiahi
Emerging Contributor

I'm trying to filter out features with Departamento = '01 - País' using the WHERE clause, using "!=", but it returns "Invalid Syntax". Here is the REST API url and this is the WHERE clause statement I'm using: 

WHERE = FECHA>=CURRENT_TIMESTAMP - INTERVAL '10' DAY 
AND Departamento != '01 - País'

 The syntax is valid with "=", but not with "!=". 

Thanks for the help!

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

"Not equals" should be "<>".

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

"Not equals" should be "<>".

- Josh Carlson
Kendall County GIS
0 Kudos
REDARiahi
Emerging Contributor

Thanks Josh, didn't think about that one! I was mislead by the documentation stating that "!=" was an accepted syntax. I'm I understanding it wrong?

0 Kudos
jcarlson
MVP Esteemed Contributor

I'd bet it's this sentence here:

Some data sources have restrictions on what is supported.

That's in reference to which SQL-92 commands are acceptable in the where parameter. I'd take a closer look at the data source you're querying and what kind of database it's running on, as that may be what's causing the issue.

- Josh Carlson
Kendall County GIS