1,删除表里面的数据
delete from命令格式:delete from 表名 where 表达式
例如,删除表 MyClass中编号为1 的记录:
mysql> delete from MyClass where id=1;
2,
创建sql语句:
CREATE TABLE `33hao_area` (
`area_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT ‘索引ID‘,
`area_name` varchar(50) NOT NULL COMMENT ‘地区名称‘,
`area_parent_id` int(11) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘地区父ID‘,
`area_sort` tinyint(3) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘排序‘,
`area_deep` tinyint(1) unsigned NOT NULL DEFAULT ‘1‘ COMMENT ‘地区深度,从1开始‘,
`area_region` varchar(3) DEFAULT NULL COMMENT ‘大区名称‘,
PRIMARY KEY (`area_id`),
KEY `area_parent_id` (`area_parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=45056 DEFAULT CHARSET=utf8 COMMENT=‘地区表‘;
3,插入数据:
INSERT INTO 33hao_area(area_id,area_name,area_parent_id,area_sort,area_deep)
SELECT region_id,region_name,parent_id,sort_order,level
FROM br_region;
导出数据:
放入数据库