您的位置:首页 > 数据库 > MySQL

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: