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

备案成功后怎么做网站腾讯云国外服务器

备案成功后怎么做网站,腾讯云国外服务器,wordpress后台管理地址更改,深圳设计网站哪个好SQL常用函数 1、字符串函数 函数调用的语法:select 函数(参数); 常用的字符串函数有: 拼接字符串,将几个字符串拼到一起:concat (s1,s2,……); select concat(你好,hello); update mytable set wherefo concat(中…

SQL常用函数

1、字符串函数

函数调用的语法:select 函数(参数);

常用的字符串函数有:

拼接字符串,将几个字符串拼到一起:concat (s1,s2,……);

select concat('你好','hello');
update mytable set wherefo = concat('中国',wherefo);

将所有字符转换为大写:upper(字符串);

select upper('hello')

将所有字符转换为小写::lower(字符串);

select lower('HELLO');

使用指定的字符对字符串左填充到指定长度:lpad(字符串,长度,填充字符);

select lpad('01',5,'*');
update mytable set number= lpad(number,10,'0');

使用指定的字符对字符串右填充到指定长度:rpad(字符串,长度,填充字符);

select rpad('01',5,'*');

去除字符串头尾的空格:trim(字符串)

select trim('  hello  ');

返回从指定位置出发长度为n的字符串子串:substring(string,start,len);

select substring('hellohello',1,5);
update mytable set number = substring(number,5,6)

2、数值函数

常见的数值函数有

对x向上取整,取大于x的最小整数:ceil(x)

select ceil(1.2);

对x向下取整,取小于x的最大整数:floor(x)

select floor(1.9);

取x/y的模,x除以y的余数:mod(x,y)

select mod(5,4);

生成0-1之间的随机数:rand()

#随机生成六位数验证码
select lpad((round(rand(),6))*1000000,6,(round(rand(),1)*10));

取x四舍五入后保留y位的数:round(x,y)

select round(3.14159,2)

3、日期函数

返回当前日期:curdate()

select curdate();

返回当前时间:curtime()

select curtime();

返回当前日期与时间:now()

select now();

获取指定date的年份:year(date)

select year('2025-3-3');

获取指定date的月份:month(date)

select month('2025-3-3');

获取指定date的日期:day(date)

select day('2025-3-3');

返回date加指定时间exp的类型后的date:date_add(date,interval exp type)

select date_add('2025-3-3',interval 70 day);

返回date1与date2相差的时间:datediff(date1,date2)

select datediff(curdate(),'2025-3-3')
select name as ‘姓名’,datediff(curdate(),dates) as '入学天数' from mytable order by '入学天数','姓名';

4、流程函数

判断value值,若为ture,则返回值1,若为false,则返回值2:if(value,值1,值2)

select name as '姓名' ,if(wherefo='中国北京','是','否') as '是否北京' from mytable;

判断值1的值,若值1不为null,则返回值1,否则返回值2:ifnull(值1,值2)

select ifnull(null,1);

若value1为ture,则返回值1,若value2为ture,则返回值2……否则返回default:case when value1 then 值1 when  value2 then 值2 ……else default end

selectname as '姓名',(case when score >=560 then '优秀'when score >=520 then '良好'when score >=480 then '及格'else '不及格'end) as '成绩情况'
from mytable;

判断exp的值,若为value1,则返回值1……否则返回default:case exp when value1 then 值1……else default end

select name as '姓名',(case wherefowhen '中国北京' then '一线城市'when  '中国上海' then '一线城市'else '其他城市'end) as '居住情况'
from mytable;

http://www.dtcms.com/a/475972.html

相关文章:

  • 建设校园网站的背景及意义广州进出口贸易有限公司
  • 广西省河池建设局网站怎样在微信做产品网站
  • 淄博外贸网站建设适合做书籍资源的WordPress主题
  • 四平网站优化中国域名网官网
  • 怎么免费做一个网站免费宣传册设计模板
  • 如何用dw做旅游网站目录大二学生做网站难吗
  • 专业的移动网站建设公wordpress插件使用Python
  • 玉林网站推广广告制作公司怎么拉业务
  • 做渠道的网站有哪些方面wordpress加载 jquery
  • 黄石网站建设报价群辉nas 做网站
  • 建设银行手机银行网站登录三个律师做网站合适吗
  • 好模板网站wordpress openload
  • 动漫网站设计理念中国产品设计网
  • 西安建设门户网站购物网站导航素材代码
  • 西安商城类网站制作西安建设厅网站首页
  • 新蔡县城乡建设局网站dw网站制作
  • 网站支付页面设计page做网站
  • 绍兴网站开发08keji深圳装饰装修公司
  • 邱县网站建设近两年成功的网络营销案例及分析
  • 沈阳网站seo排名优化嘉兴注册公司
  • 做网站维护工作难吗免费行情网站链接
  • 网站建设平台官网河间米各庄互联网上网络营销的推广
  • 湖南seo网站多少钱天津网站建设需要多少钱
  • 网站建设国风网络公司wordpress猜你喜欢功能
  • 百度搜索网站怎么做网站可以给pdf做笔记
  • 曲靖住房和城乡建设局网站建设工程施工合同 示范文本
  • 海南网站建设fwlit软件开发模型包括哪些
  • VMWare和物理机之间文件传输
  • 自助建网站系统看电影工业厂房设计
  • 网页制作与网站建设从入门到精通 下载网站改版 总结