重命名 rename table oldname to newname
修改表长度: alter table poi3 modify poi_name varchar(400);
建联合索引(也可以去重复):
唯一:alter ignore table poi3 add unique index poi_name,address,phone_number);
其他:alter table xc add index ind_name(name),add index ind_status(status);
删除索引:drop index addr_index on poi3;
查看建表语句: show create table name;
给表增加字段:alter table poi3 add rpoi_id int(11) ;
删除字段:alter table r_poi drop column fir_copy;
修改表:
alter table r_poi modify smell double(5,1),modify server double(5,1),modify aura double(5,1);
导出查询结果:
mysql -uroot -plbs26ps lbs_comment -e"select sc from r_poi_comment limit 20">1.txt
操作数值:
四舍五入:round()
舍去小数: floor()
如果小数部分有值就进一 ceil() 或者 ceiling()
排重:
insert into temp(poi_id,img) select poi_id,url from r_poi_img;
insert into temp1(id) select id from temp group by poi_id having count(distinct poi_id) =1;
loadfile:
mysql -h127.0.0.1 -uroot -pyicha.123 smartad -e "LOAD DATA LOCAL INFILE 'click_temp.txt' into table click_temp (ad_id)";
分享到:
相关推荐
文件里有常用的MYsql命令 MySQL常用命令 文件里有常用的MYsql命令 MySQL常用命令
MYSQL常用命令,快速上手使用教程,简单txt格式
MySql常用命令 MySql常用命令 MySql常用命令
MySQL常用命令 MySQL常用命令 MySQL常用命令
MYSQL常用命令MYSQL常用命令MYSQL常用命令 MYSQL常用命令MYSQL常用命令 MYSQL常用命令
MySQL常用命令汇总 包含数据库使用以及navicat 快捷键水说明很详细, 包含命令行的是使用以及连接数据库如何操作的详细说明
MySQL常用命令MySQL常用命令MySQL常用命令
MYSQL常用命令 1.导出整个数据库 mysqldump -u 用户名 -p --default-character-set=latin1 数据库名 > 导出的文件名(数据库默认编码是latin1) mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql 2.导出一个表 ...
MySQL常用命令总结 MySQL常用命令总结
基于MySQL数据库的常用命令 最新版
MySQL常用命令
MySql常用命令总结MySql常用命令总结MySql常用命令总结MySql常用命令总结MySql常用命令总结MySql常用命令总结
MySQL常用命令大全,常用mysql命令行命令 .MySql中的SQL语句.
MySQL常用命令.docMySQL常用命令.doc
mysql常用命令汇总,mysql常用命令汇总,非常详细,值得下载
个人总结的MySQL常用的命令语句,非常实用,免得用到的时候还得去网上搜索。
MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,属于 Oracle 旗下产品。MySQL 是最流行的关系型数据库管理系统之一,在 WEB 应用方面,MySQL是最好的 RDBMS (Relational ...此文件是MySQL常用命令速查手册
为了大家学习Mysql的方便,在下收集一些Mysql常用命令的查询语句。希望给大家带来方便。
MySQL常用命令视频教程及笔记(为PDF格式)