@@ -32929,7 +32928,7 @@ column value even if it isn't unique. The following gives the value of
column:
@example
substr(MIN(concat(rpad(sort,6,' '),column)),7)
SUBSTR(MIN(CONCAT(RPAD(sort,6,' '),column)),7)
@end example
@xref{example-Maximum-column-group-row}.
...
...
@@ -33119,7 +33118,7 @@ In MySQL Version 3.22.5 or later, you can also write queries like this:
@example
mysql> SELECT user,MAX(salary) FROM users
-> group by user HAVING max(salary)>10;
-> GROUP BY user HAVING MAX(salary)>10;
@end example
In older MySQL versions, you can write this instead:
...
...
@@ -34355,10 +34354,10 @@ For example, to read a file of jokes, that are separated with a line
of @code{%%}, into a SQL table you can do:
@example
create table jokes (a int not null auto_increment primary key, joke text
not null);
load data infile "/tmp/jokes.txt" into table jokes fields terminated by ""
lines terminated by "\n%%\n" (joke);
CREATE TABLE jokes (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, joke TEXT
NOT NULL);
LOAD DATA INFILE "/tmp/jokes.txt" INTO TABLE jokes FIELDS TERMINATED BY ""
LINES TERMINATED BY "\n%%\n" (joke);
@end example
@code{FIELDS [OPTIONALLY] ENCLOSED BY} controls quoting of fields. For
...
...
@@ -34852,11 +34851,11 @@ with @code{DELETE FROM table_name} (without a @code{WHERE}) in
@strong{NOTE:} There can be only one @code{AUTO_INCREMENT} column per
table, and it must be indexed. MySQL Version 3.23 will also only
work properly if the auto_increment column only has positive
work properly if the @code{AUTO_INCREMENT} column only has positive
values. Inserting a negative number is regarded as inserting a very large
positive number. This is done to avoid precision problems when
numbers 'wrap' over from positive to negative and also to ensure that one
doesn't accidentally get an auto_increment column that contains 0.
doesn't accidentally get an @code{AUTO_INCREMENT} column that contains 0.
In MyISAM and BDB tables you can specify @code{AUTO_INCREMENT} secondary
column in a multi-column key. @xref{example-AUTO_INCREMENT}.
...
...
@@ -34980,7 +34979,7 @@ Only the @code{MyISAM} table type supports indexing on @code{BLOB} and
@code{TEXT} columns. When putting an index on a @code{BLOB} or @code{TEXT}
column you MUST always specify the length of the index:
@example
CREATE TABLE test (blob_col BLOB, index(blob_col(10)));
CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));
@end example
@item
...
...
@@ -35046,7 +35045,7 @@ The options work for all table types, if not otherwise indicated:
@multitable @columnfractions .25 .75
@item @strong{Option} @tab @strong{Description}
@item @code{AUTO_INCREMENT} @tab The next auto_increment value you want to set for your table (MyISAM).
@item @code{AUTO_INCREMENT} @tab The next @code{AUTO_INCREMENT} value you want to set for your table (MyISAM).
@item @code{AVG_ROW_LENGTH} @tab An approximation of the average row length for your table. You only need to set this for large tables with variable size records.
@item @code{CHECKSUM} @tab Set this to 1 if you want MySQL to maintain a checksum for all rows (makes the table a little slower to update but makes it easier to find corrupted tables) (MyISAM).
@item @code{COMMENT} @tab A 60-character comment for your table.
...
...
@@ -35689,9 +35688,9 @@ is issued:
@example
mysql> USE db1;
mysql> SELECT count(*) FROM mytable; # selects from db1.mytable
mysql> SELECT COUNT(*) FROM mytable; # selects from db1.mytable
mysql> USE db2;
mysql> SELECT count(*) FROM mytable; # selects from db2.mytable
mysql> SELECT COUNT(*) FROM mytable; # selects from db2.mytable
@end example
Making a particular database current by means of the @code{USE} statement
...
...
@@ -37233,7 +37232,6 @@ INSERT INTO t2 (message) VALUES ("Testing"),("table"),("t2");
CREATE TABLE total (a INT NOT NULL, message CHAR(20), KEY(a))
TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
@end example
@c CAPPING DONE TO HERE
Note that we didn't create a @code{UNIQUE} or @code{PRIMARY KEY} in the
@code{total} table as the key isn't going to be unique in the @code{total}