mysql个人笔记
2014-10-27 22:36
381 查看
show databases;
use dbname;
show tables;
desc tablename;
create table new_table (
id varchar(12) primary not null default 0,
name varchar(20),
age int,
area varchar(10)
);
insert into new_table(
id,name,age,area)
values
('12345','jim',21,'beijing');
drop table new_table;
增删插()
alter table new_table add
sex ;
导出数据表文件》》 select new_table from jxc into outfile 'd:/t.xlsx;'
select new_table from jxc into outfile 'd:/t.txt;'
( 解决乱码问题:select new_table from jxc into outfile 'd:/t.txt' CHARACTER SET gbk; OK)
使用查询结果创建表》》 首先说明MYSQL不支持:Select * Into new_table_name from old_table_name;
使用下面两个方法:
1、Create table new_table_name (Select * from old_table_name);
select * into new_table_name from old_table_name;
2、SELECT * INTO OUTFILE 'a.txt' FROM table_name;
LOAD DATA INFILE '/database/mysql/a.txt' INTO TABLE new_table_name;
use dbname;
show tables;
desc tablename;
create table new_table (
id varchar(12) primary not null default 0,
name varchar(20),
age int,
area varchar(10)
);
insert into new_table(
id,name,age,area)
values
('12345','jim',21,'beijing');
drop table new_table;
增删插()
alter table new_table add
sex ;
导出数据表文件》》 select new_table from jxc into outfile 'd:/t.xlsx;'
select new_table from jxc into outfile 'd:/t.txt;'
( 解决乱码问题:select new_table from jxc into outfile 'd:/t.txt' CHARACTER SET gbk; OK)
使用查询结果创建表》》 首先说明MYSQL不支持:Select * Into new_table_name from old_table_name;
使用下面两个方法:
1、Create table new_table_name (Select * from old_table_name);
select * into new_table_name from old_table_name;
2、SELECT * INTO OUTFILE 'a.txt' FROM table_name;
LOAD DATA INFILE '/database/mysql/a.txt' INTO TABLE new_table_name;
相关文章推荐
- mysql建表常用语句 个人笔记分享
- 个人笔记mysql游标
- Mysql存储过程个人笔记
- 【个人笔记】mysql重安
- php+中文分词scws+sphinx+mysql+只作为个人笔记,请点击下面链接到原地址查看
- mysql 个人笔记
- MySql技巧个人笔记
- MySql技巧个人笔记
- mysql视图--纯属个人笔记
- mysql事务 个人笔记
- css属性编写顺序+mysql基本操作+html细节(个人笔记)
- Mysql个人语句笔记
- mysql 个人笔记
- 关于linuxcast网站课程中MYSQL安装配置基础课程的个人笔记
- MYSQL优化技术--------------------个人笔记
- mysql个人散乱笔记,慎重参考
- FreeBSD 安装Mysql apache PHP 个人笔记
- MySQL优化建议--个人学习笔记
- MySQL简单的触发器,个人笔记
- mysql个人笔记