WL#5084: Symmetric BETWEEN

Affects: Server-Prototype Only   —   Status: Un-Assigned

Allow the keywords SYMMETRIC and ASYMMETRIC in BETWEEN clauses.

Syntax:
a [ NOT ] BETWEEN [ ASYMMETRIC | SYMMETRIC ] b AND c

ASYMMETRIC is default. ASYMMETRIC is noise, it's current behaviour.

If b <= c, then SYMMETRIC and ASYMMETRIC work the same way.
If b > c, then SYMMETRIC in effect reverses the operands.
For example:
2 BETWEEN 3 AND 1             -- FALSE
2 BETWEEN SYMMETRIC 3 AND 1   -- TRUE

ASYMMETRIC and SYMMETRIC are new reserved words.

This is SQL:2003 non-core (optional) feature T461.

Not supported by Oracle 11g:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/conditions011.htm#sthref2955

Not supported by SQL Server 2008:
http://msdn.microsoft.com/en-us/library/ms187922.aspx

Not supported by DB2 9.5:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.sql.ref.doc/doc/r0000748.html

References
----------

BUG#46867 Support SQL 2003 SYMMETRIC/ASYMMETRIC options for BETWEEN clause
(Feature request)
http://bugs.mysql.com/bug.php?id=46867

[ Peter Gulutzan 2009-08-26 ]