Oracle 5.0 Reference Manual page 1321

Table of Contents

Advertisement

To create a
table, you must specify a
MERGE
tables to use. You can optionally specify an
MyISAM
into the
table take place. Use a value of
MERGE
or last underlying table, respectively. If you specify no
value of NO, inserts into the
The following example shows how to create a
mysql>
CREATE TABLE t1 (
->
a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
->
message CHAR(20)) ENGINE=MyISAM;
mysql>
CREATE TABLE t2 (
->
a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
->
message CHAR(20)) ENGINE=MyISAM;
mysql>
INSERT INTO t1 (message) VALUES ('Testing'),('table'),('t1');
mysql>
INSERT INTO t2 (message) VALUES ('Testing'),('table'),('t2');
mysql>
CREATE TABLE total (
->
a INT NOT NULL AUTO_INCREMENT,
->
message CHAR(20), INDEX(a))
->
ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
The older term
is supported as a synonym for
TYPE
the preferred term and
Note that column
is indexed as a
a
the
table. There it is indexed but not as a
MERGE
enforce uniqueness over the set of underlying tables. (Similarly, a column with a
underlying tables should be indexed in the
After creating the
MERGE
whole:
mysql>
SELECT * FROM total;
+---+---------+
| a | message |
+---+---------+
| 1 | Testing |
| 2 | table
|
| 3 | t1
|
| 1 | Testing |
| 2 | table
|
| 3 | t2
|
+---+---------+
To remap a
table to a different collection of
MERGE
methods:
the
table and re-create it.
DROP
MERGE
• Use
ALTER TABLE tbl_name UNION=(...)
Beginning with MySQL 5.0.60, it is also possible to use
an empty
clause) to remove all of the underlying tables.
UNION
As of MySQL 5.0.36, the underlying table definitions and indexes must conform more closely than
previously to the definition of the
table is opened, not when the
MERGE
the operation that triggered the opening of the table fails. This means that changes to the definitions
of tables within a
MERGE
checks applied to each table are:
• The underlying table and the
• The column order in the underlying table and the
• Additionally, the specification for each corresponding column in the parent
underlying tables are compared and must satisfy these checks:
The
Storage Engine
MERGE
UNION=(list-of-tables)
table are not permitted and attempts to do so result in an error.
MERGE
is deprecated.
TYPE
PRIMARY KEY
MERGE
table, you can use it to issue queries that operate on the group of tables as a
table. Conformance is checked when a table that is part of a
MERGE
table is created. If any table fails the conformance checks,
MERGE
may cause a failure when the
table must have the same number of columns.
MERGE
1301
INSERT_METHOD
or
to cause inserts to be made in the first
FIRST
LAST
INSERT_METHOD
table:
MERGE
for backward compatibility, but
ENGINE
in the underlying
MyISAM
because a
PRIMARY KEY
table but not as a
UNIQUE
tables, you can use one of the following
MyISAM
to change the list of underlying tables.
ALTER TABLE ... UNION=()
table is accessed. The conformance
MERGE
table must match.
MERGE
option that indicates which
option to control how inserts
option or if you specify it with a
ENGINE
tables, but not in
table cannot
MERGE
index in the
UNIQUE
index.)
(that is, with
table and the
MERGE
is

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents