获取mysql列名以及复制mysql的表记录
因为调试程序分页效果需要快速的添加一些记录,复制当然是最方便的方法:
insert into table1(f1,f2) select f1,f2 from table1 where id < 10;
SHOW COLUMNS FROM hugetable;DESCRIBE hugetable;
+------------+----------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+------------+----------+------+-----+---------+----------------+| Id | int(11) | NO | PRI | NULL | auto_increment || Name | char(35) | NO | | | || Country | char(3) | NO | UNI | | |
select column_name from information_schema.columns where table_name='hugetable';