Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite SQL Elements Reference » Expressions in UltraLite » Search conditions in UltraLite

EXISTS conditions Next Page

IN conditions

Checks membership by searching a value from the main query with another value in the subquery.


expression [ NOT ] IN
{ ( subquery ) | ( value-expr, ... ) }


value-expr are expressions that take on a single value, which may be a string, a number, a date, or any other SQL data type.


An IN condition, without the NOT keyword, evaluates according to the following rules:

You can reverse the logic of the IN condition by using the NOT IN form.

The following search condition expression IN ( values ) is identical to the search condition expression = ANY ( values ). The search condition expression NOT IN ( values ) is identical to the search condition expression <> ALL ( values ).


Select the company name and state for customers who live in the following Canadian provinces: Ontario, Manitoba, and Quebec.

SELECT CompanyName , Province
FROM Customers
WHERE State IN( 'ON', 'MB', 'PQ')