《与mysql零距离接触》视屏学习笔记
2016-04-10 17:54
411 查看
1、数据表的增删改查操作(crud):
对于表:
增:create table XXXX
删:drop table XXXX
改:alter table XXXX rename to XXXX
查:select * from XXXX
对于行:
增:insert into XXXX(xxxx) values (xxxx)
insert into XXXX set xxxx=xx , xxxx=xx
删:delete from XXXX where xxxx
改:update table set xxxx=xxxx where xxxx=xxxx
查:select xxxx from XXXX
对于列:
增:alter table XXXX add xxxx()
删:alter table XXXX drop xxxx
改:alter table XXXX change xxxx xxxx xxxx
alter table XXXX modify xxxx xxxx
查:show columns from XXXX
2、运算符与函数
字符函数
Concat() select concat('hha','-','hdf')
Concat_ws() select concat_ws('=','A','B','C')
Format() select format(125060.752,2)
Lower() select lower('HIIHO')
Upper() select upper('fsfds')
Left() select left('fsfds',2)
Right() select right('fsfds',2)
Length() select length(' fsfds ')
Ltrim() select ltrim(' fsfds ')
Rtrim() select rtrim(' fsfds ')
Trim() select trim(' fsfds ')
select trim(leading '?' from ' fs?fds ')
select trim(trailing '?' from ' fs?fds ')
select trim(both '?' from ' fs?fds ')
Substring() select substring(' fsfds ',2,3)
select substring(' fsfds ',2)
Like select 'myufsd' like 'm%'
select * from test where first_name like '%1%%' escape '1'
%代表任意个字符
_代表任意一个字符
Replace() select replace('fsgasgsfa','s','t')
3、数值运算符
Div 整数除法
4、比较运算符合函数
Not between and
Not in
5、时间和日期函数
Now()
Curdate()
Curtime()
Date_add()
Datediff()
Date_format()
6、信息函数
Connection_id()
Datebase()
Last_insert_id()
User()
Version()
7聚合函数
。。。
8、加密函数
Md5()
Password()
对于表:
增:create table XXXX
删:drop table XXXX
改:alter table XXXX rename to XXXX
查:select * from XXXX
对于行:
增:insert into XXXX(xxxx) values (xxxx)
insert into XXXX set xxxx=xx , xxxx=xx
删:delete from XXXX where xxxx
改:update table set xxxx=xxxx where xxxx=xxxx
查:select xxxx from XXXX
对于列:
增:alter table XXXX add xxxx()
删:alter table XXXX drop xxxx
改:alter table XXXX change xxxx xxxx xxxx
alter table XXXX modify xxxx xxxx
查:show columns from XXXX
2、运算符与函数
字符函数
Concat() select concat('hha','-','hdf')
Concat_ws() select concat_ws('=','A','B','C')
Format() select format(125060.752,2)
Lower() select lower('HIIHO')
Upper() select upper('fsfds')
Left() select left('fsfds',2)
Right() select right('fsfds',2)
Length() select length(' fsfds ')
Ltrim() select ltrim(' fsfds ')
Rtrim() select rtrim(' fsfds ')
Trim() select trim(' fsfds ')
select trim(leading '?' from ' fs?fds ')
select trim(trailing '?' from ' fs?fds ')
select trim(both '?' from ' fs?fds ')
Substring() select substring(' fsfds ',2,3)
select substring(' fsfds ',2)
Like select 'myufsd' like 'm%'
select * from test where first_name like '%1%%' escape '1'
%代表任意个字符
_代表任意一个字符
Replace() select replace('fsgasgsfa','s','t')
3、数值运算符
Div 整数除法
4、比较运算符合函数
Not between and
Not in
5、时间和日期函数
Now()
Curdate()
Curtime()
Date_add()
Datediff()
Date_format()
6、信息函数
Connection_id()
Datebase()
Last_insert_id()
User()
Version()
7聚合函数
。。。
8、加密函数
Md5()
Password()
相关文章推荐
- 开发检测MySQL主从同步插件
- MySQL数据库、数据表和字段字符集查询、修改和配置
- MySQL数据库锁机制之MyISAM引擎表锁和InnoDB行锁详解
- Mac之Mysql安装
- Mysql语句优化原则整理
- MySQL学习笔记(4) 2016-04-10
- mysql数据库批量快速插入
- Mac安装 mysql 数据库总结
- MYSQL 中的常见问题(包括数据筛选)
- kettle中MySQL批量加载
- kettle中MySQL批量加载
- 初始化MySQL
- 不同的msyq版本和不同的mysql驱动会出现不兼容问题
- [MySQL]Mysql常用命令-20160410
- mysql优化
- mysql 的 select into
- MySQL学习笔记10(MySQL函数)
- 清除mysql表中数据
- debian下安装mysql
- Mac mysql 数据库安装总结