请教老师个问题
CREATE TABLE tdb_goods_brand( brand_id SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, brand_name VARCHAR(40) NOT NULL ) SELECT brand_name FROM tdb_goods GROUP BY brand_name;
为什么SELECT 查询出来的brand_name会自动的添加到参照表的brand_name字段呢,而不是插入brand_id字段呢?
CREATE TABLE tdb_goods_brand( brand_id SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, brand_name VARCHAR(40) NOT NULL ) SELECT brand_name FROM tdb_goods GROUP BY brand_name;
为什么SELECT 查询出来的brand_name会自动的添加到参照表的brand_name字段呢,而不是插入brand_id字段呢?
2016-04-28
举报