Database Toolbox Previous page   Next Page

Condition

In the Where Clauses dialog box, after selecting an item from Fields, select the Condition that restricts the query results for that item. Complete the fields in the Where Clauses dialog box for the condition you selected.

The conditions you can select are:

After selecting the condition, specify an Operator to add other conditions, or click Apply to create the where clause.

Relation

  1. For Condition, select Relation.
  2. Select the comparison type for the restriction. The types you can select are: =, <, >, >=, <=, and <> (not equal to).
  3. Specify the comparison value. Put strings (but not field names) in single quotation marks.
  1. You can specify the comparison value to be the field from a table in order to associate values from multiple tables. In SQL, this is called a join operation. For details, see the Example Creating Queries for Results from Multiple Tables.

Examples of Relation Condition.   This example restricts results to where the value for the selected field (such as the stock number) is greater than 400000.

This example equates the stockNumber from productTable with the StockNumber from the salesVolume table.

Between

  1. For Condition, select Between.
  2. Type the minimum and maximum values to restrict the results.

Example of Between Condition.   This example restricts results to where the value for the selected field (such as the stock number) is greater than 400000 and less than 500000.

In

  1. For Condition, select In.
  2. Type the set of values that you want the results to be restricted to. Include parentheses around the set of values and separate values by commas. Put strings in quotes.

Example of In Condition.   This example restricts results to where the value for the selected field (such as the supplier's country) is Ireland or Northern Ireland.

Is Null

For Condition, select Is null to restrict results to those where the value for the specified field is NULL.

Like

  1. From Condition, select Like.
  2. Type the pattern of the value you want to use to restrict results. Put strings in single quotation marks. Include wildcards before and/or after the pattern. Use the % wildcard to represent any number of characters, or an underscore ( _ ) for any single character.

Example of Like Condition.   This example restricts results for the selected field (such as the supplier number) to those ending in the 50s.

See Also


Previous page  Fields Operator Next page

© 1994-2005 The MathWorks, Inc.