跳转到内容

欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。

MySQL:命令整理

来自WHY42
imported>Soleverlee2016年7月21日 (四) 14:01的版本 (→特殊查询)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

常用函数

函数 备注
database() 获取当前use的数据库名称
version() 获取数据库版本信息
ifnull(field, 'Something') 测试是否为空,为空则返回默认值
current_date() 获取当前日期
select rol_id, ifnull(remark, 'No Remark') from rol;

特殊查询

  • limit:限制查询结果条数
select * from rol limit 5;
  • 查询到文件中:
select content into dumpfile 'd:/1.hex' from wf_process where name='projectFlow';