Oracle 5.0 Reference Manual page 558

Table of Contents

Advertisement

Note that this means that
"Cast Functions and
mysql>
SET sql_mode = '';
mysql>
SELECT CAST(0 AS UNSIGNED) - 1;
+-------------------------+
| CAST(0 AS UNSIGNED) - 1 |
+-------------------------+
|
18446744073709551615 |
+-------------------------+
mysql>
SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';
mysql>
SELECT CAST(0 AS UNSIGNED) - 1;
+-------------------------+
| CAST(0 AS UNSIGNED) - 1 |
+-------------------------+
|
+-------------------------+
[538]
NO_ZERO_DATE
In strict mode, do not permit
option. When not in strict mode, the date is accepted but a warning is generated. (Added in
IGNORE
MySQL 5.0.2)
NO_ZERO_IN_DATE
In strict mode, do not accept dates where the year part is nonzero but the month or day part is 0 (for
example,
'0000-00-00'
option, MySQL inserts a
IGNORE
the date is accepted but a warning is generated. (Added in MySQL 5.0.2)
ONLY_FULL_GROUP_BY
Do not permit queries for which the select list or (as of MySQL 5.0.23)
nonaggregated columns that are not named in the
The following queries are invalid with
because
in the select list is not named in the
address
in the
max_age
HAVING
mysql>
SELECT name, address, MAX(age) FROM t GROUP BY name;
ERROR 1055 (42000): 't.address' isn't in GROUP BY
mysql>
SELECT name, MAX(age) AS max_age FROM t GROUP BY name
->
HAVING max_age < 30;
Empty set (0.00 sec)
ERROR 1463 (42000): Non-grouping field 'max_age' is used in HAVING clause
In the second example, the query could be rewritten to use
reference is to a column named in an aggregate function.
function.)
In addition, if a query has aggregate functions and no
nonaggregated columns in the select list or
mysql>
SELECT name, MAX(age) FROM t;
ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...)
with no GROUP columns is illegal if there is no GROUP BY clause
For more information, see
Server SQL Modes
BIGINT UNSIGNED
Operators".
-1 |
'0000-00-00'
[538]
is legal but
'2010-00-01'
'0000-00-00'
[538]
ONLY_FULL_GROUP_BY
clause is not named in the
Section 12.15.3, "MySQL Extensions to
538
is not 100% usable in all contexts. See
as a valid date. You can still insert zero dates with the
and
'2010-01-00'
date for any such date. When not in strict mode,
clause.
GROUP BY
[538]
GROUP BY
clause:
GROUP BY
HAVING MAX(age)
(max_age
clause, it cannot have
GROUP BY
list:
ORDER BY
Section 12.10,
are not). If used with the
list refers to
HAVING
enabled. The first is invalid
clause, and the second because
instead, so that the
fails because it is an aggregate
GROUP
BY".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents