W dniu 2011-12-07 13:36, Tomasz Chiliński pisze:
SHOW COLUMNS FROM customerassignments; SHOW INDEX FROM customerassignments;
mysql> SHOW COLUMNS FROM customerassignments; +-----------------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+---------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | customergroupid | int(11) | NO | MUL | NULL | | | customerid | int(11) | NO | MUL | NULL | | +-----------------+---------+------+-----+---------+----------------+ 3 rows in set (0.00 sec)
mysql> SHOW INDEX FROM customerassignments; +---------------------+------------+-----------------+--------------+-----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +---------------------+------------+-----------------+--------------+-----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | customerassignments | 0 | PRIMARY | 1 | id | A | 2 | NULL | NULL | | BTREE | | | | customerassignments | 0 | customergroupid | 1 | customergroupid | A | 2 | NULL | NULL | | BTREE | | | | customerassignments | 0 | customergroupid | 2 | customerid | A | 2 | NULL | NULL | | BTREE | | | | customerassignments | 1 | customer_idx | 1 | customerid | A | 14 | NULL | NULL | | BTREE | | | +---------------------+------------+-----------------+--------------+-----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 4 rows in set (0.00 sec)