summaryrefslogtreecommitdiff
path: root/Docs/manual.texi
diff options
context:
space:
mode:
authorunknown <tim@threads.polyesthetic.msg>2001-03-07 16:35:44 -0500
committerunknown <tim@threads.polyesthetic.msg>2001-03-07 16:35:44 -0500
commit9e114f040e0d3335a6d52440232115375e1d0fa6 (patch)
tree06eda97108be5ba8a25a7cac5ae2327647f8f343 /Docs/manual.texi
parentc60c6f3a369b54d77aa4622197bef1da6b805b97 (diff)
parentb0089e699a4ed1c9287726185835d701a297cfd6 (diff)
downloadmariadb-git-9e114f040e0d3335a6d52440232115375e1d0fa6.tar.gz
Merge work.mysql.com:/home/bk/mysql
into threads.polyesthetic.msg:/usr/local/src/my/work Docs/manual.texi: Auto merged
Diffstat (limited to 'Docs/manual.texi')
-rw-r--r--Docs/manual.texi14
1 files changed, 12 insertions, 2 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 154353b2063..f315bd3652f 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -17919,6 +17919,7 @@ Returns the bitwise @code{AND} of all bits in @code{expr}. The calculation is
performed with 64-bit (@code{BIGINT}) precision.
@end table
+@cindex @code{GROUP BY}, extensions to ANSI SQL
@strong{MySQL} has extended the use of @code{GROUP BY}. You can use columns or
calculations in the @code{SELECT} expressions that don't appear in
the @code{GROUP BY} part. This stands for @emph{any possible value for this
@@ -17937,8 +17938,9 @@ In ANSI SQL, you would have to add @code{customer.name} to the @code{GROUP
BY} clause. In @strong{MySQL}, the name is redundant if you don't run in
ANSI mode.
-Don't use this feature if the columns you omit from the @code{GROUP BY} part
-aren't unique in the group!
+@strong{Don't use this feature} if the columns you omit from the
+@code{GROUP BY} part aren't unique in the group! You will get
+unpredictable results.
In some cases, you can use @code{MIN()} and @code{MAX()} to obtain a specific
column value even if it isn't unique. The following gives the value of
@@ -19292,6 +19294,7 @@ to tell the optimizer that the result set will have many rows. In this case,
temporary table with a key on the @code{GROUP BY} elements.
@item
+@cindex @code{GROUP BY}, extensions to ANSI SQL
If you use @code{GROUP BY}, the output rows will be sorted according to the
@code{GROUP BY} as if you would have had an @code{ORDER BY} over all the fields
in the @code{GROUP BY}. @strong{MySQL} has extended the @code{GROUP BY} so that
@@ -19302,6 +19305,13 @@ SELECT a,COUNT(b) FROM test_table GROUP BY a DESC
@end example
@item
+@strong{MySQL} has extended the use of @code{GROUP BY} to allow you to
+select fields which are not mentioned in the @code{GROUP BY} clause.
+If you are not getting the results you expect from your query, please
+read the @code{GROUP BY} description.
+@xref{Group by functions}.
+
+@item
@code{SQL_BUFFER_RESULT} will force the result to be put into a temporary
table. This will help @strong{MySQL} free the table locks early and will help
in cases where it takes a long time to send the result set to the client.