Sun WBEM SDK Developer's Guide

The SELECT Statement

The SELECT statement is the SQL statement for retrieving information, with a few restrictions and extensions specific to WQL. Although the SQL SELECT statement is typically used in the database environment to retrieve particular columns from tables, the WQL SELECT statement is used to retrieve instances of a single class. WQL does not support queries across multiple classes.

The SELECT statement specifies the properties to query in an object specified in the FROM clause.

The basic syntax for the SELECT statement is:

SELECT instance FROM class

The following tables shows examples of using arguments in the SELECT clause to refine a search.

Table 4–5 SELECT Statement

Example Query 

Description 

SELECT * FROM class

Selects all instances of the specified class and any of its subclasses. 

SELECT PropertyA FROM class 

Selects only instances of the specified class and any of its subclasses that contain PropertyA.

SELECT PropertyA, PropertyB FROM class

Selects only instances of the specified class and any of its subclasses that contain PropertyA or PropertyB.