SELECT p.type_id,p.type_name,s.type_name FROM tdb_goods_types p LEFT JOIN
tdb_goods_types s ON s.parent_id = p.type_id GROUP BY p.type_id;
tdb_goods_types s ON s.parent_id = p.type_id GROUP BY p.type_id;
2015-04-06
mysql> ALTER TABLE tdb_goods
-> CHANGE goods_cate cate_id SMALLINT UNSIGNED NOT NULL,
-> CHANGE brand_name brands_id SMALLINT UNSIGNED NOT NULL;
Query OK, 22 rows affected (0.96 sec)
Records: 22 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM tdb_goods\G;
-> CHANGE goods_cate cate_id SMALLINT UNSIGNED NOT NULL,
-> CHANGE brand_name brands_id SMALLINT UNSIGNED NOT NULL;
Query OK, 22 rows affected (0.96 sec)
Records: 22 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM tdb_goods\G;
2015-04-06