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

SQL Anywhere 12.0.1 » SQL Anywhere 服务器 - SQL 的用法 » 查询和修改数据 » 查询 » WHERE 子句:指定行

 

用于比较日期的搜索条件

可以使用等号以外的运算符选择一组满足搜索条件的行。不等式运算符(< 和 >)可用于比较数字、日期、甚至是字符串。

 ♦ 列出所有生于 1964 年 3 月 13 日以前的雇员
  • 在 Interactive SQL 中,执行以下查询:

    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
    ... ...
 注意
 另请参见