![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
我是一枚小白白
这个作者很懒,什么都没留下…
展开
-
MYSql赋予用户权限、删除权限
创建用户 create user 用户名identified by "密码";例子:create user test identified by "123456";赋予查询权限:grant select on test.v_a to usertest@'%';FLUSH PRIVILEGES; ----刷新MySQL的系统权限相关表查看当前用户(自己)权限:show grants; 查看其他 MySQL用户权限:show ...原创 2020-07-06 17:39:09 · 465 阅读 · 0 评论 -
模糊查询like 如何查找 包含% 或者_的行
第一种方式。用/ 和escape '/'来转义。select * from a where 列名 like '%/_%' escape '/';第二种方式:用匹配函数查找select * from a where instr(列名,‘_’)>0locate(str1,str)position(str1 in str)instr(str,str1)...原创 2020-06-02 17:33:05 · 1670 阅读 · 1 评论 -
HIVE判断字符串是否是数字
seelct '123456' rlike '^\\d+$' ; true ;seelct '123456a' rlike '^\\d+$' ; false;原创 2020-06-01 11:17:08 · 8589 阅读 · 1 评论 -
MYSQL查所有表的条数,字段信息
查表名,数据条数、表注释select table_name,table_rows,TABLE_COMMENT from information_schema.tables where TABLE_SCHEMA = ‘数据库名’ order by table_rows desc;. 要查询表字段的注释/* 查询数据库下表 ‘字段及注释 */SELECT COLUMN_NAME,column_comment FROM INFORMATION_SCHEMA.Columns WHERE table_nam原创 2020-05-28 15:49:17 · 417 阅读 · 0 评论 -
关于select* from a,b笛卡尔积,若一个表为空讨论
如果表A的有一个列a值是1,2,3。如果表B的有一个列b值是1,2,3。select * from A,B1,12,13,11,22,23,2…但是如果A或B的数据为空。则返回的是空。原创 2020-05-21 11:13:22 · 563 阅读 · 0 评论