You can use operators other than equals to select a set of rows that satisfy the search condition. The inequality operators (< and >) can be used to compare numbers, dates, and even character strings.
List all employees born before March 13, 1964
In Interactive SQL, execute the following query:
SELECT Surname, BirthDate FROM Employees WHERE BirthDate < 'March 13, 1964' ORDER BY BirthDate DESC; |
Surname |
BirthDate |
---|---|
Ahmed | 1963-12-12 |
Dill | 1963-07-19 |
Rebeiro | 1963-04-12 |
Garcia | 1963-01-23 |
Pastor | 1962-07-14 |
... | ... |
Automatic conversion to dates The SQL Anywhere database server knows that the BirthDate column contains dates, and automatically converts the string 'March 13, 1964'
to a date.
Ways of specifying dates There are many ways of specifying dates. For example:
'March 13, 1964' '1964/03/13' '1964-03-13' |
You can configure the interpretation of dates in queries by setting the date_order option database option. See date_order option [compatibility].
Dates in the format yyyy/mm/dd or yyyy-mm-dd are always recognized unambiguously as dates, regardless of the date_order setting.
Other comparison operators SQL Anywhere supports several comparison operators. See Comparison operators.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |