The SQL Procedure |
sql-expression <NOT> BETWEEN sql-expression
AND sql-expression |
Argument |
is described in sql-expression.
Details |
The sql-expressions must be of compatible data types. They must be either all numeric or all character types.
Because a BETWEEN condition evaluates the boundary values as a range, it is not necessary to specify the smaller quantity first.
You can use the NOT logical operator to exclude a range of numbers, for example, to eliminate customer numbers between 1 and 15 (inclusive) so that you can retrieve data on more recently acquired customers.
PROC SQL supports the same comparison operators that the DATA step supports. For example:
x between 1 and 3 x between 3 and 1 1<=x<=3 x>=1 and x<=3
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.