Hi Roy
On 12/09/2008, at 7:51 PM, Roy Lyseng wrote:
[EMAIL PROTECTED] wrote:
I'm a little confused (and fairly new to the list), so please
forgive me if
I've got the wrong end of the stick...
So the SQL standard states that NOT has high precedence so
NOT a BETWEEN b AND c
evaluates to
(NOT a) BETWEEN b AND c
(does anyone have a link to the SQL standard?)
I am afraid the SQL standard is not freely available.
I am not sure about the semantics of this without studying the
SQL-2003 standard carefully. However, in SQL-92 there were no
boolean data types in SQL, so "(NOT a)" would not make any sense and
"NOT a BETWEEN b AND c" would naturally be interpreted as "NOT (a
BETWEEN b AND c)". So, this is just a problem with "a" being BOOLEAN
and "NOT a" being a reasonable expression.
Being able to specify NOT on a non-boolean expression is a MySQL
extension.
Don't feel like delving into this again but at the time this was
abundantly discussed internally at MySQL, among others by Peter
Gulutzan ("SQL-99 Complete, Really" book) and myself.
What the mysql docs say is correct and what MySQL does by default
since 5.0.3 is also what for instance MSSQL does.
If Drizzle for some curious reason had it the other way round (I
somehow doubt that) it needs to be fixed.
Cheers,
Arjen.
--
Arjen Lentz, Founder @ Open Query
Training and Expertise for MySQL in Australia and New Zealand
http://openquery.com.au/training/ (ph. +61-7-3103 0809)
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp