Show/Hide Toolbars

Filopto Help Manual

 

The WHERE clause is used to specify that only certain rows of the table are to be displayed, based on the criteria described in that WHERE clause. It is most easily understood by looking at a couple of examples.

 

If you wanted to see the EMPLOYEEIDNO's of those earning a salary of $50,000 or over, use the following:

 

 SELECT EMPLOYEEIDNO

 FROM EMPLOYEESTATISTICSTABLE

 WHERE SALARY >= 50000;

 

Notice that the >= (greater than or equal to) sign is used since we wanted to see those who earned a salary equal to or greater than $50,000, listed together. This displays:

 

 EMPLOYEEIDNO

 ------------

 010

 105

 152

 215

 244

 

The WHERE description, SALARY >= 50000, is known as a condition (an operation which evaluates to True or False). The same can be done for text columns:

 

SELECT EMPLOYEEIDNO

FROM EMPLOYEESTATISTICSTABLE

WHERE Title = 'Manager';

 

This displays the ID Numbers of all Managers. Generally, with text columns, stick to equal to or not equal to, and make sure that any text that appears in the statement is surrounded by single quotes ( ' ).