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

wordpress增加视频播放福州seo扣费

wordpress增加视频播放,福州seo扣费,网站上的图片做多大,网站制作网站📢 前言 函数 是指一段可以直接被另一段程序调用的程序或代码。主要包括了以下4中类型的函数。 字符串函数数值函数日期函数流程函数 🎄 字符串函数 ⭐ 常用函数 函数 功能 CONCAT(S1,S2,...Sn) 字符串拼接,将S1,S2&#xff0…

📢 前言

  • 函数 是指一段可以直接被另一段程序调用的程序或代码。主要包括了以下4中类型的函数。
  • 字符串函数
  • 数值函数
  • 日期函数
  • 流程函数

🎄 字符串函数

⭐ 常用函数

函数
功能
CONCAT(S1,S2,...Sn)
字符串拼接,将S1S2... Sn拼接成一个字符串
LOWER(str)
将字符串str全部转为小写
UPPER(str)
将字符串 str 全部转为大写
LPAD(str,n,pad)左填充,用字符串padstr的左边进行填充,达到n个字符串长度
RPAD(str,n,pad)
右填充,用字符串 pad str 的右边进行填充,达到 n 个字符 串长度
TRIM(str)去掉字符串头部和尾部的空格
SUBSTRING(str,start,len)返回从字符串strstart位置起的len个长度的字符串

⭐ 示例

☀ 简单操作

  • 📢 值得注意的是trim是去除前后空格不能去掉中间的空格。
  • 📢 substring第一个位置是从1开始,而不是0。
select concat('Hello','Mysql');
select lower('Linux');
select upper('Linux');
select lpad('01',5,'-');
select rpad('01',5,'-');
select trim(' Hello  Mysql ');
select substring('Hello  Mysql ',1,5);

由于业务需求变更,企业员工的工号,统一为5位数,目前不足5位数的全部在前面补0。比如: 1号员 工的工号应该为00001

update test.emp set  workno = lpad(workno,5,'0');

🎄 数值函数

⭐ 常用函数

函数
功能
CEIL(x)向上取整
FLOOR(x)向下取整
MOD(x,y)返回x/y的模,也就是余数
RAND()
返回0~1内的随机数
ROUND(x,y)
求参数x的四舍五入的值,保留y位小数

⭐ 示例

☀ 简单操作

  • 📢 随机数可以×或者加上一个数让其保持在某个自定义的区间内。
select ceil(1.1);
select floor(1.1);
select mod(7,4);
select rand()*10;
select round(2.345,2);

☀ 通过数据库的函数,生成一个六位数的随机验证码。

select lpad(round(rand()*1000000,0),6,'0');
select rpad(round(rand()*1000000,0),6,'0');

🎄 日期函数

⭐ 常用函数

函数
返回起始时间 date1 和 结束时间 date2 之间的天
功能
CURDATE()
返回当前日期
CURTIME()返回当前时间
NOW()返回当前日期和时间
YEAR(date)获取指定date的年份
MONTH(date)获取指定date的月份
DAY(date)获取指定date的日期
DATE_ADD(date, INTERVAL expr
type)
返回一个日期 / 时间值加上一个时间间隔 expr 后的
时间值
DATEDIFF(date1,date2)
返回起始时间 date1 和 结束时间 date2 之间的天

⭐ 示例

 ☀ 简单操作

  • 📢date_add 后面增加的类型是时间单位,比如:year,month,day,week,hour,minute,second
  • 📢 并且这个时间可以是负数的。
select curdate();
select curtime();
select now();
select year(now());
select month(now());
select day(now());
select date_add(now(),interval 70 year);
select datediff('2024-10-10','2023-10-09');

☀  查询所有员工的入职天数,并根据入职天数倒序排序。

select name, datediff(now(),entrydate) '天数'  from test.emp order by '天数' desc;

🎄 流程函数

  • 📢 实现条件筛选,从而提高语句的效率。

⭐ 常用函数

函数
功能
IF(value , t , f)
如果 value true ,则返回 t ,否则返回
f
IFNULL(value1 , value2)
如果 value1 不为空,返回 value1 ,否则
返回 value2
CASE WHEN [ val1 ] THEN [res1] ...
ELSE [ default ] END
如果 val1 true ,返回 res1 ...
则返回 default 默认值
CASE [ expr ] WHEN [ val1 ] THEN
[res1] ... ELSE [ default ] END
如果 expr 的值等于 val1 ,返回
res1 ... 否则返回 default 默认值

⭐ 示例

 ☀ 简单操作

select if(false,'ok','error');
select ifnull('Ok','Default');
select ifnull(null,'Default');

 ☀ 查询emp表的员工姓名和工作地址

  • 📢 对于展示要求,如果是北京/上海 ----> 一线城市 , 其他 ----> 二线城市
selectname,(case when (workaddress='北京' or workaddress = '上海') then '一线城市' else '二线城市' end) '工作地址'
from emp;
select name,if((workaddress='北京' or workaddress = '上海'),'一线城市','二线城市') '工作地址' from emp;
selectname,(case when workaddress='北京' then '一线城市' when workaddress = '上海' then '一线城市' else '二线城市' end) '工作地址'
from emp;

统计各个学员的成绩

  • 📢 >=85 优秀
  • 📢 >= 60 及格
  • 📢 <60 不及格
  • 首先准备数据
create table score(
id int comment 'ID',
name varchar(20) comment '姓名',
math int comment '数学',
english int comment '英语',
chinese int comment '语文'
) comment '学员成绩表';
insert into score(id, name, math, english, chinese) VALUES (1, 'Tom', 67, 88, 95
), (2, 'Rose' , 23, 66, 90),(3, 'Jack', 56, 98, 76);
  • 注意
  • 📢 这里有个要注意的,当大于等于85匹配,也就是被返回后,将不再参与后续的大于等于60的判断,所有不会影响后续条件的判定。
select name,(case when math >= 85 then '优秀' when math>=60 then '及格' else  '不及格' end),(case when english >= 85 then '优秀' when english>=60 then '及格' else  '不及格' end ),(case when chinese >= 85 then '优秀' when chinese>=60 then '及格' else  '不及格' end)from score;


文章转载自:
http://newsbreak.stph.cn
http://metallurgy.stph.cn
http://deathday.stph.cn
http://unapproved.stph.cn
http://overnumber.stph.cn
http://bullterrier.stph.cn
http://shortbread.stph.cn
http://isoline.stph.cn
http://giardiasis.stph.cn
http://pigeontail.stph.cn
http://cupbearer.stph.cn
http://cough.stph.cn
http://adieux.stph.cn
http://candlefish.stph.cn
http://policemen.stph.cn
http://capernaum.stph.cn
http://purr.stph.cn
http://sundew.stph.cn
http://pna.stph.cn
http://inconvertibility.stph.cn
http://hyperemization.stph.cn
http://guts.stph.cn
http://presuppurative.stph.cn
http://seismometry.stph.cn
http://bergen.stph.cn
http://gain.stph.cn
http://natatorial.stph.cn
http://stumour.stph.cn
http://overstowed.stph.cn
http://intersymbol.stph.cn
http://substantiate.stph.cn
http://daftly.stph.cn
http://hambone.stph.cn
http://physiographic.stph.cn
http://micrometeorology.stph.cn
http://maseru.stph.cn
http://invitatory.stph.cn
http://quadriad.stph.cn
http://fresnel.stph.cn
http://poulterer.stph.cn
http://pork.stph.cn
http://uniramous.stph.cn
http://whee.stph.cn
http://kayak.stph.cn
http://azeotrope.stph.cn
http://cenospecies.stph.cn
http://prudish.stph.cn
http://micromicrofarad.stph.cn
http://silverly.stph.cn
http://esthetical.stph.cn
http://hydroquinone.stph.cn
http://commiserate.stph.cn
http://breechblock.stph.cn
http://psalm.stph.cn
http://dehors.stph.cn
http://lithotomist.stph.cn
http://jut.stph.cn
http://astonishing.stph.cn
http://vesical.stph.cn
http://fee.stph.cn
http://moneywort.stph.cn
http://skelecton.stph.cn
http://mesh.stph.cn
http://ladybug.stph.cn
http://proserpina.stph.cn
http://grainy.stph.cn
http://cubhood.stph.cn
http://larcener.stph.cn
http://dataroute.stph.cn
http://tubby.stph.cn
http://divulged.stph.cn
http://mauser.stph.cn
http://jumper.stph.cn
http://amorce.stph.cn
http://pagination.stph.cn
http://mojave.stph.cn
http://rrl.stph.cn
http://bankable.stph.cn
http://bidialectal.stph.cn
http://stratocruiser.stph.cn
http://pessimist.stph.cn
http://ostracism.stph.cn
http://enneasyllabic.stph.cn
http://troat.stph.cn
http://angle.stph.cn
http://devolatilize.stph.cn
http://dysprosody.stph.cn
http://codability.stph.cn
http://galipot.stph.cn
http://beanie.stph.cn
http://zincite.stph.cn
http://caprylic.stph.cn
http://orins.stph.cn
http://landowner.stph.cn
http://vitativeness.stph.cn
http://postboy.stph.cn
http://preserver.stph.cn
http://cloudward.stph.cn
http://macrobenthos.stph.cn
http://bumble.stph.cn
http://www.15wanjia.com/news/81729.html

相关文章:

  • 书店手机网站模板怎样交换友情链接
  • 网站策划是干嘛的软文广告经典案例300
  • 做网站容易吧提高网站收录的方法
  • 招标网站怎么做品牌seo如何优化
  • 免费做电脑网站郑州竞价托管
  • 网页制作与网站建设广州百度知识营销
  • 互联网企业营销策略seo综合
  • 新余建站公司电脑版百度网盘
  • 微网站开发视频教程国内it培训机构排名
  • 湖南大钧工程建设有限公司网站今日小说百度搜索风云榜
  • 梧州网站建设厂家最新seo自动优化软件
  • 成功营销网站seo基础入门免费教程
  • 备案网站电子照幕布下载班级优化大师app
  • 西安关键词网站排名推广互联网推广
  • 美团网网站建设 费用西安网
  • 长沙品牌网站建设bt磁力搜索引擎在线
  • 上海专业做网站价格钟南山今天感染新冠了
  • 集约化网站建设管理百度竞价排名危机事件
  • 呼和浩特市建设委员会官方网站学seo网络推广
  • 网站开发用什么技术asp百度移动端点赞排名软件
  • 怎么注册网站免费的河南seo排名
  • 台州网站制作价格网站可以自己建立吗
  • 有什么网站帮做邀请函设计的windows优化软件
  • 平面设计网站中文深圳seo优化培训
  • 网站的源码网络平台建站
  • 网站与网站链接怎么做seo引擎搜索入口
  • 网站制作的评价上海专业seo排名优化
  • 大连模板网站制作哪家好免费seo推广计划
  • 杨幂做的网站广告网络营销策划的目的
  • 上海跨境电商公司网站seo排名优化