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

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Functions » Alphabetical list of functions

ERRORMSG function [Miscellaneous] Next Page

ESTIMATE function [Miscellaneous]

Provides selectivity estimates for the query optimizer, based on specified parameters.


ESTIMATE( column-name [, value [, relation-string ] ] )


column-name    The column used in the estimate.

value    The value to which the column is compared. The default is NULL.

relation-string    The comparison operator used for the comparison, enclosed in single quotes. Possible values for this parameter are: =, >, <, >= , <=, <>, !=, !<, and !>. The default is =.


If value is NULL then the relation strings '=' and '!=' are interpreted as the IS NULL and IS NOT NULL conditions, respectively.

See also
Standards and compatibility

The following statement returns the percentage of EmployeeID values estimated to be greater than 200. The precise value depends on the actions you have carried out on the database.

SELECT FIRST ESTIMATE( EmployeeID, 200, '>' )
   FROM Employees;