Mysql语句
2016-07-11 15:33
274 查看
locate(‘a’,‘abcd’)----得到a在abcd中的位置。值为1;
length(‘abcd’)----得到abcd的长度。值为4;
substr(‘abcd’,1,2)----得到从a开始截取两个字符后的字符串。值为ab;
replace(‘abcd’,‘a’,‘x’)----得到替换后的字符转为xbcd;
2016/7/14
获的表里的所有字段
select column_name from information_schema.columns where table_schema='test' and table_name='test1'
获得数据库所有的表名
select table_name from information_schema.tables where table_schema='test' and table_type='base table';
获得标的创建语句
SHOW CREATE TABLE test1
length(‘abcd’)----得到abcd的长度。值为4;
substr(‘abcd’,1,2)----得到从a开始截取两个字符后的字符串。值为ab;
replace(‘abcd’,‘a’,‘x’)----得到替换后的字符转为xbcd;
2016/7/14
获的表里的所有字段
select column_name from information_schema.columns where table_schema='test' and table_name='test1'
获得数据库所有的表名
select table_name from information_schema.tables where table_schema='test' and table_type='base table';
获得标的创建语句
SHOW CREATE TABLE test1
相关文章推荐
- Ubuntu server 16.04 安装mysql并设置远程访问
- MySql数据库查询结果用表格输出PHP代码示例
- MySQL更改列名
- MySQL字符函数
- MySQL数据库迁移
- mysql root密码重置报错
- The fastest MySQL Sandbox setup ever!
- mysql 排名
- mysql 密码问题解决方案
- MySQL之——mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- PowerDesigner和Navicat for mysql的基础使用心得
- mysql数据不完整迁移脚本
- mysql 行转列
- MYSQL附近的人设计思路
- 安装zabbix
- mysql 优化
- MySQL 添加列,修改列,删除列
- Mysql常见的错误代码
- sql注入进阶--跑向mysql
- mysql语句里时间格式化