NQL where
A where
clause allows you to add conditions to your query to filter the results.
Comparing field value to a fixed reference
Compare field value to a fixed reference to filter results that match a specific, unchanging criterion. For example:
Filter devices with a specific operating system.
Filter devices with free memory below a specified threshold.
Filter specific binary versions.
Syntax
Examples
Select the devices running the Windows operating system.
nxt-gcarlisa
Windows
nxt-wmirjam
Windows
Select the devices not running the Windows operating system.
nxt-jdoe
macOS
nxt-vlatona
macOS
Select the users whose name contains “jo”.
John Fisher
John Doe
Comparing two field values against each other
Compare two field values against each other when you wish to filter results based on a dynamic relationship between fields. Only fields from the same table can be compared against each other.
You can compare the following fields:
native fields
context fields
metrics (aliases) computed in the query
manual custom fields
Syntax
Examples
Comparing native fields
Identify users which don't use the same peripheral for both the speaker and the microphone.
Comparing a native field with a context field
Filter out events where the device has changed location
Comparing native field to computed metric
Identify devices which have not had any Collector activity after an execution crash.
Comparing native field to a manual custom field
Compare the package version to a required compliant version that is stored in a manual custom field.
Using multiple conditions
Use multiple filters separated by and
or or
operators to apply more complex conditions. The conditions in the filter are grouped together to preserve the order of precedence. When you put where
clauses on separate lines, the result is the same as if you created one where
clause with multiple and
conditions.
The following queries provide the exact same results.
Last updated