当前位置: 首页 > news >正文

wordpress怎样排版seo公司

wordpress怎样排版,seo公司,网站建设思维,网站开发的软件工程师叫什么文章目录 一、函数1、ifnull2、if3、case4、exists 存在5、字符串函数(重点)6、数学函数7、日期函数 二、TCL语句1、创建用户2、赋予权限3、修改mysql允许远程登录 一、函数 1、ifnull 当前⾯的值是null的时候,使⽤后⾯的默认值 ifnull(字段…

文章目录

  • 一、函数
    • 1、ifnull
    • 2、if
    • 3、case
    • 4、exists 存在
    • 5、字符串函数(重点)
    • 6、数学函数
    • 7、日期函数
  • 二、TCL语句
    • 1、创建用户
    • 2、赋予权限
    • 3、修改mysql允许远程登录


一、函数

1、ifnull

当前⾯的值是null的时候,使⽤后⾯的默认值
ifnull(字段,默认值) – 参数就是两个,第一个参数需要判断的字段,第二个是默认值

2、if

if(条件,值1,值2) – 前⾯的条件如果成⽴,取值第⼀个,否则取值第⼆个

3、case

case when … then … else … end

-- 行转列
select sname,sum(case  when subject='语文' then score else 0 end) '语文',sum(case  when subject='数学' then score else 0 end) '数学',sum(case  when subject='英语' then score else 0 end) '英语',sum(case  when subject='历史' then score else 0 end) '历史',sum(case  when subject='政治' then score else 0 end) '政治',sum(case  when subject='体育' then score else 0 end) '体育'
from sc group by sname;

等同于:

select sname,
sum(if(subject='语文',score,0)) 语文,
sum(if(subject='数学',score,0)) 数学,
sum(if(subject='英语',score,0)) 英语,
sum(if(subject='历史',score,0)) 历史,
sum(if(subject='政治',score,0)) 政治,
sum(if(subject='体育',score,0)) 体育from sc group by sname;

4、exists 存在

exists的作用为判断一个表中的数据,是否在另外的一张表中能够查询到与之对应的数据

-- 查询一个数据是否存在,存在里面的结果集中,如果存在,显示出来,不存在不显示
select * from dept where exists(select * from emp where emp.deptno = dept.deptno
);

5、字符串函数(重点)

-- 获取字符串⻓度
select char_length('Hello');
-- 变⼤写
select upper('Hello');
-- 变⼩写
select lower('Hello');
-- 空⽩字符串切割
select trim(' Hello ');   -- 左右两边的空⽩字符全部切掉
select ltrim(' Hello ');  -- 只切除左边的空⽩字符
select rtrim(' Hello ');  -- 只切右边
-- ⽐较两个字符串是否相等,⽐较的肯定是内容
select strcmp('hello','hello');   -- 如果相等返回0,不等于返回 1 或者 -1
-- 截取⼀段字符串
select substr('hello',2,3);   -- 2 代表的是第⼆个字符的位置,3代表的是截取的⻓度
-- 将字符串进⾏反转
select reverse('hello');
-- 替换
select replace('hello','l','a');
-- 字符串的拼接,有两种
-- 1)使⽤某个拼接符进⾏拼接s,第一个参数为分隔符,第二个可以是数组或者集合
select concat_ws(':',arr/list);
-- 2) 可以不指定拼接符(默认为逗号分隔),中间也可以指定分隔符
select concat('hello','world');

6、数学函数

-- 绝对值
select abs(-1);
-- 天花板 向上取整
select ceil(1.99);
-- 地板砖 向下取整
select FLOOR(1.99);
-- 除以
select 10 div 5;
select 10/5;
-- 求最⼩值和最⼤值
select least(10,20,4,50,18);   -- 最小值
select greatest(10,20,4,50,18);  --最大值
-- 求余数
select 5%2;
select MOD(5,2);
-- 求次⽅
select POW(2,3);
-- 开根号
select sqrt(16);
-- PI 
select PI();
-- 获取0到1之间的随机数,不包含1
select rand();
-- 随机获取 [3,10)
select floor (rand() * 7 + 3 );
-- 四舍五⼊
select round(1.56); -- 2
select round(1.22); -- 1
-- 数据进⾏格式化处理 最后⼀位进⾏四舍五⼊的处理
select format(3.1415926,3);
-- 保留⼩数点后⼏位,不会四舍五⼊
select TRUNCATE(1.35675,3);

7、日期函数

--获取当前时间
select now() ;
-- 查询当前时间 年⽉⽇的形式
select current_data();
-- 时分秒的形式
select current_time();
-- 年⽉⽇时分秒
select current_timestamp();
-- 某个⽇期多少天以后
select adddtae('2022-07-21',interval 10 day);
-- 某个时间多少⼩时分钟秒之后
select addtime('2022-07-21 09:57:00','2:00:00');
-- 获取两个时间的差值
select abs(datediff('2022-07-11','2022-07-21'));
-- 将数据格式化为其他的样式 %r 可以展示上午还是下午
select date_format('2022-07-11','%y年%m⽉%d⽇');
-- 获取天
select day('2022-07-11');
select year('2022-07-11');
-- 获取给定的⽉份
select month('2022-07-11');
-- 该⽇期是这个⽉/年/周的第⼏天
select dayofmonth('2022-07-11');
select dayofweek('2022-07-11'); -- 2
select dayofyear('2022-07-11'); -- 192
-- 获取某个⽉的最后⼀天的⽇期
select last_day(current_date());
-- 获取当前时间,包含时分秒,跟current_timestamp效果⼀样
select now();
-- 专⻔⽤于减天数的函数
select subdate(now(),1);

二、TCL语句

1、创建用户

语法: create user ‘⽤户名’@‘主机名’ identified by ‘密码’;
创建了⼀个⽤户,其实就是在mysql数据库中的user表中,插⼊了⼀条记录⽽已。

2、赋予权限

-- 语法
grant 权限1,权限2 ..... on 某个数据库中的⼀些表 to '⽤户名'@'主机名'
grant insert,update,select on sql.* to 'xxxxxx'@'localhost';
-- all privileges 所有权限的意思
grant all privileges on . to 'xxxxxx'@'localhost' identified by '123456' with grant option;-- 刷新权限
flush privileges;-- 重置密码:
alter user 'root'@'localhost' identified by 'root';

3、修改mysql允许远程登录

-- 创建用户
create user 'root'@'%' identified by 'root';
-- 赋权限
grant all privileges on . to 'root'@'%' with grant option;
http://www.hengruixuexiao.com/news/16835.html

相关文章:

  • flash分享网站网站免费建站app
  • 南通网站建设小程序成都百度快照优化排名
  • 广东平台网站建设平台网络建站优化科技
  • 地产主视觉设计网站百度热门排行榜
  • 奇米网怎么做网站推广营销网络
  • 深圳百度网站优化优秀软文范例100字
  • 庐山市建设规划局网站郑州seo推广
  • 国内网页做的好看的网站如何建立免费公司网站
  • wordpress更改文件上传目录天津百度搜索排名优化
  • 网站如何选择关键词百度竞价收费标准
  • 福州网站建设公司本地免费发布信息网站
  • 长沙网站建设0731网上营销方式和方法
  • 建设银行网站会员怎么用网站优化方案模板
  • 专门做油画交流的网站seo流程
  • 高端网站建设公司兴田德润在那里win7运行速度提高90%
  • 信息网站建设汇报电话营销系统
  • 上海做网站费用如何推广平台
  • 深圳企业做网站公司有哪些移动端排名优化软件
  • 网站排名优化培训哪家好宣传网站站点最有效的方式是
  • 商业网站首页怎么做网络seo推广培训
  • 如何通过做网站赚钱googleplay官网
  • 哪个网站做logo北京sem
  • app网站开发学习网络营销概述ppt
  • 工作简历模板范文seo排名第一的企业
  • 站长之家 wordpress网络运营培训课程
  • bootstrap制作的网站页面百度账号注册中心
  • 查看网站建设的特点网站keywords
  • 菏泽去哪了做网站互联网营销是干什么
  • 做vip兼职设计师的网站有哪些百度网盘人工申诉电话
  • 建个淘宝那样的网站需要多少钱短视频运营是做什么的