Click to Rate and Give Feedback
MSDN
MSDN Library
WMI Reference
WMI and SQL
WQL (SQL for WMI)
WQL Operators

  Switch on low bandwidth view
WQL Operators

The Windows Management Instrumentation Query Language (WQL) supports a set of standard operators that are used in the WHERE clause of a SELECT statement, as follows.

OperatorDescription
=Equal to
<Less than
>Greater than
<=Less than or equal to
>=Greater than or equal to
!= or <>Not equal to

 

There are a few additional WQL-specific operators: IS, IS NOT, ISA, and LIKE. The IS and IS NOT operators are valid in the WHERE clause only if the constant is NULL. For example, the following queries are valid:

SELECT * FROM Win32_LogicalDisk WHERE FileSystem IS NULL
SELECT * FROM Win32_LogicalDisk WHERE FileSystem IS NOT NULL

The following queries show invalid uses of IS and IS NOT:

SELECT * FROM Win32_LogicalDisk WHERE DriveType IS 5
SELECT * FROM Win32_LogicalDisk WHERE FileSystem IS NOT "NTFS"

The ISA operator is used in the WHERE clause of data and event queries to test embedded objects for a class hierarchy. The ISA operator eliminates the need for keeping track of newly-derived classes when requesting a hierarchy of classes. When you use ISA, newly-created and existing subclasses of the requested class are automatically included in the result set.

For more information about the syntax and use of this operator, see the following topics:

The LIKE operator is valid in the WHERE clause and is used to determine whether a given character string matches a specified pattern. For example, the following query returns all instances of Win32_ classes.

SELECT * FROM Meta_Class WHERE __Class LIKE %Win32%

For more information about the syntax and use of this operator, see LIKE Operator.

Send comments about this topic to Microsoft

Build date: 6/15/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker