Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

IN Clause (Spider)

JoeWinter edited this page Sep 19, 2014 · 1 revision

[Table of Contents](https://github.com/dell-oss/Doradus/wiki/Spider Databases: Table-of-Contents) | Previous | Next
Doradus Query Language: IN Clause


A field can be tested for membership in a set of values using the IN clause. Examples:

Size IN (512,1024,2048,4096,8192,16384,32768,65536)
LastName IN (Jones, Smi*, Vledick)
Manager IN (shf637, dhs729, fjj901)
_ID IN (sjh373,whs873,shc729)

As shown, values are enclosed in parentheses and separated by commas. If the comparison field is a text field, values can use wildcards. Link fields and the _ID field are compared to object IDs. Literals that are not a simple term must be enclosed in single or double quotes.

The IN clause is a shorthand for a series of OR clauses. For example, the following clause:

LastName IN (Jones, Smi*, Vledick)

is the same as the following OR clauses:

LastName = Jones OR LastName = Smi* OR LastName = Vledick

As a synonym for the IN keyword, Doradus also allows the syntax field*=(*list*)*. For example, the following two clauses are equivalent:

LastName IN (Jones, Smi*, Vledick)
LastName=(Jones, Smi*, Vledick)
Clone this wiki locally