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

织梦网站手机版端设置网站根目录在哪儿

织梦网站手机版端设置,网站根目录在哪儿,家政公司,国内新闻最新消息摘抄目录 1. 整体学习的思维导图 2. 日期函数 ​编辑 2.1 current_date() 2.2 current_time() 2.3 current_timestamp() 2.4 date(datetime) 2.5 now() 2.6 date_add() 2.7 date_sub() 2.8 datediff() 2.9 案例 2.9.1 创建一个出生日期登记簿 2.9.2 创建一个留言版 3…目录 1. 整体学习的思维导图 2. 日期函数 ​编辑 2.1 current_date() 2.2 current_time()  2.3 current_timestamp() 2.4 date(datetime) 2.5 now() 2.6 date_add() 2.7 date_sub() 2.8 datediff() 2.9 案例 2.9.1 创建一个出生日期登记簿 2.9.2 创建一个留言版 3. 字符串函数 案例 3.1 charset() 获取字符串的字符集 3.2 concat() 拼接两个字符串  3.3 instr(string, substring) 查找string是否出现substring 3.4 ucase(string)/lcase(string) 转换大写/小写  3.5 length(string) 可以查看占用的字节数 3.6 replace(str, replace_str, seach_str) 替换 3.7 substring(str, pos, length) 去字符串从pos位置(起始位置为1)开始length长度  3.8 使用scott数据库emp表以首字母小写的方式显示所有员工的姓名  4. 数学函数 5. 其他函数 user() 查询当前用户 database()查看当前使用的数据库  password()函数MySQL数据库使用该函数对用户加密  ifnullval1 val2 如果val1为null返回val2否则返回val1的值  1. 整体学习的思维导图 2. 日期函数 2.1 current_date() 用于显示当前时间的年月日  mysql select current_date(); ---------------- | current_date() | ---------------- | 2024-11-19 | ---------------- 1 row in set (0.00 sec) 2.2 current_time()  用于显示当前时间的时分秒  mysql select current_time(); ---------------- | current_time() | ---------------- | 20:17:15 | ---------------- 1 row in set (0.00 sec) 2.3 current_timestamp() 用于显示当前时间的时间戳 mysql select current_timestamp(); --------------------- | current_timestamp() | --------------------- | 2024-11-19 20:18:21 | --------------------- 1 row in set (0.00 sec) 2.4 date(datetime) 用于返回当前时间的参数的日期部分也就是年月日 mysql select date(1949-10-1 00:00:00) as 日期参数; -------------- | 日期参数 | -------------- | 1949-10-01 | -------------- 1 row in set (0.00 sec) 2.5 now() 返回当前时间也可以配合前面的date()函数使用。 mysql select now(); --------------------- | now() | --------------------- | 2024-11-25 20:02:57 | ---------------------mysql select date(now()); ------------- | date(now()) | ------------- | 2024-11-25 | ------------- 2.6 date_add() 在日期的基础上加上日期 select date_add(日期, interval () 单位); 给当前时间加上10天加上10小时加上10分钟 mysql select now(); --------------------- | now() | --------------------- | 2024-11-25 20:07:14 | ---------------------mysql select date_add(now(), interval 10 day); ---------------------------------- | date_add(now(), interval 10 day) | ---------------------------------- | 2024-12-05 20:06:52 | ----------------------------------mysql select date_add(now(), interval 10 hour); ----------------------------------- | date_add(now(), interval 10 hour) | ----------------------------------- | 2024-11-26 06:07:34 | -----------------------------------mysql select date_add(now(), interval 10 minute); ------------------------------------- | date_add(now(), interval 10 minute) | ------------------------------------- | 2024-11-25 20:17:48 | ------------------------------------- 2.7 date_sub() 在日期的基础上减去日期 select date_add(日期, interval () 单位); 给当前时间减去10天减去10小时减去10分钟 mysql select now(); --------------------- | now() | --------------------- | 2024-11-25 20:09:22 | ---------------------mysql select date_sub(now(), interval 10 day); ---------------------------------- | date_sub(now(), interval 10 day) | ---------------------------------- | 2024-11-15 20:09:33 | ----------------------------------mysql select date_sub(now(), interval 10 hour); ----------------------------------- | date_sub(now(), interval 10 hour) | ----------------------------------- | 2024-11-25 10:09:38 | -----------------------------------mysql select date_sub(now(), interval 10 minute); ------------------------------------- | date_sub(now(), interval 10 minute) | ------------------------------------- | 2024-11-25 19:59:43 | ------------------------------------- 2.8 datediff() 算出两个日期相差多少天 mysql select datediff(date(now()), 1949-10-1); ------------------------------------ | datediff(date(now()), 1949-10-1) | ------------------------------------ | 27449 | ------------------------------------ 2.9 案例 2.9.1 创建一个出生日期登记簿 其中包含姓名性别出生日期 mysql create table Date_Book(- name varchar(20) comment 姓名,- gender char(2) comment 性别,- born date comment 出生日期- );mysql insert into Date_Book(name, gender, born) values(欧阳, 男, current_date());mysql select * from Date_Book where name欧阳; ---------------------------- | name | gender | born | ---------------------------- | 欧阳 | 男 | 2024-11-25 | ---------------------------- 2.9.2 创建一个留言版 其中包含id留言内容留言时间 mysql create table Talk_Book( - id tinyint primary key auto_increment, - content varchar(100) comment 留言内容, - time datetime comment 留言时间 );mysql insert into Talk_Book(content, time) values(不知天上宫阙今夕是何年, current_timestamp);mysql insert into Talk_Book(content, time) values(明月几时有, 把酒问青天, current_timestamp);mysql insert into Talk_Book(content, time) values(人生若只如初见,何事秋风悲画扇, current_timestamp);mysql select * from Talk_Book; ---------------------------------------------------------------------- | id | content | time | ---------------------------------------------------------------------- | 1 | 不知天上宫阙今夕是何年 | 2024-11-25 20:25:19 | | 2 | 明月几时有, 把酒问青天 | 2024-11-25 20:26:03 | | 3 | 人生若只如初见,何事秋风悲画扇 | 2024-11-25 20:26:37 | ---------------------------------------------------------------------- 3. 字符串函数 案例 3.1 charset() 获取字符串的字符集 mysql select charset(ename) from emp; ---------------- | charset(ename) | ---------------- | utf8 | | utf8 | | utf8 | | utf8 | | utf8 | | utf8 | ---------------- 3.2 concat() 拼接两个字符串  mysql select concat(name,:,语文分数是, chinese,分, 数学分数是, math,分, 英语分数是, english, 分。) as 总分 from stu_SJ; ------------------------------------------------------------------------------------ | 总分 | ------------------------------------------------------------------------------------ | 唐三藏:语文分数是134分数学分数是196分英语分数是112分。 | | 孙悟空:语文分数是120分数学分数是200分英语分数是79分。 | | 猪悟能:语文分数是120分数学分数是196分英语分数是180分。 | | 曹孟德:语文分数是140分数学分数是180分英语分数是134分。 | | 刘玄德:语文分数是160分数学分数是230分英语分数是90分。 | | 孙权:语文分数是140分数学分数是146分英语分数是156分。 | | 宋公明:语文分数是150分数学分数是190分英语分数是60分。 | ------------------------------------------------------------------------------------ 3.3 instr(string, substring) 查找string是否出现substring 如果出现返回出现的开始位置 没有出现返回0 mysql select instr(Hello, World, World); -------------------------------- | instr(Hello, World, World) | -------------------------------- | 8 | --------------------------------mysql select instr(欧阳牛马, 牛马); --------------------------------- | instr(欧阳牛马, 牛马) | --------------------------------- | 3 | --------------------------------- 3.4 ucase(string)/lcase(string) 转换大写/小写  mysql select ucase(hello,world); ---------------------- | ucase(hello,world) | ---------------------- | HELLO,WORLD | ----------------------mysql select lcase(HELLO,WORLD); ---------------------- | lcase(HELLO,WORLD) | ---------------------- | hello,world | ---------------------- 3.5 length(string) 可以查看占用的字节数 空格不算字符字符串长度空格不算字符串。 mysql select * from stu_SJ limit 3; --------------------------------------- | id | name | chinese | math | english | --------------------------------------- | 1 | 唐三藏 | 134 | 196 | 112 | | 2 | 孙悟空 | 120 | 200 | 79 | | 3 | 猪悟能 | 120 | 196 | 180 | ---------------------------------------mysql select length(name) 名字长度 from stu_SJ limit 3; -------------- | 名字长度 | -------------- | 9 | | 9 | | 9 | -------------- 注意length函数返回字符串长度以字节为单位。如果是多字节字符则计算多个字节数如果是单字节字符则算作一个字节。比如字母数字算作一个字节中文表示多个字节数与字符集编码有关 3.6 replace(str, replace_str, seach_str) 替换 mysql select * from stu_SJ; --------------------------------------- | id | name | chinese | math | english | --------------------------------------- | 1 | 唐三藏 | 134 | 196 | 112 | | 2 | 孙悟空 | 120 | 200 | 79 | | 3 | 猪悟能 | 120 | 196 | 180 | | 4 | 曹孟德 | 140 | 180 | 134 | | 5 | 刘玄德 | 160 | 230 | 90 | | 6 | 孙权 | 140 | 146 | 156 | | 7 | 宋公明 | 150 | 190 | 60 | ----------------------------------------- 将name中所有的悟字替换为无mysql select replace(name, 悟, 无) from stu_SJ; ----------------------------- | replace(name, 悟, 无) | ----------------------------- | 唐三藏 | | 孙无空 | | 猪无能 | | 曹孟德 | | 刘玄德 | | 孙权 | | 宋公明 | ----------------------------- 3.7 substring(str, pos, length) 去字符串从pos位置(起始位置为1)开始length长度  mysql select * from stu_SJ; --------------------------------------- | id | name | chinese | math | english | --------------------------------------- | 1 | 唐三藏 | 134 | 196 | 112 | | 2 | 孙悟空 | 120 | 200 | 79 | | 3 | 猪悟能 | 120 | 196 | 180 | | 4 | 曹孟德 | 140 | 180 | 134 | | 5 | 刘玄德 | 160 | 230 | 90 | | 6 | 孙权 | 140 | 146 | 156 | | 7 | 宋公明 | 150 | 190 | 60 | ----------------------------------------- 截取表中name的前两个字符 mysql select substring(name, 1, 2) from stu_SJ; ----------------------- | substring(name, 1, 2) | ----------------------- | 唐三 | | 孙悟 | | 猪悟 | | 曹孟 | | 刘玄 | | 孙权 | | 宋公 | ----------------------- 3.8 使用scott数据库emp表以首字母小写的方式显示所有员工的姓名  mysql select * from emp; -------------------------------------------------------------------------------- | empno | ename | job | mgr | hiredate | sal | comm | deptno | -------------------------------------------------------------------------------- | 007369 | SMITH | CLERK | 7902 | 1980-12-17 00:00:00 | 800.00 | NULL | 20 | | 007499 | ALLEN | SALESMAN | 7698 | 1981-02-20 00:00:00 | 1600.00 | 300.00 | 30 | | 007521 | WARD | SALESMAN | 7698 | 1981-02-22 00:00:00 | 1250.00 | 500.00 | 30 | | 007566 | JONES | MANAGER | 7839 | 1981-04-02 00:00:00 | 2975.00 | NULL | 20 | | 007654 | MARTIN | SALESMAN | 7698 | 1981-09-28 00:00:00 | 1250.00 | 1400.00 | 30 | | 007698 | BLAKE | MANAGER | 7839 | 1981-05-01 00:00:00 | 2850.00 | NULL | 30 | | 007782 | CLARK | MANAGER | 7839 | 1981-06-09 00:00:00 | 2450.00 | NULL | 10 | | 007788 | SCOTT | ANALYST | 7566 | 1987-04-19 00:00:00 | 3000.00 | NULL | 20 | | 007839 | KING | PRESIDENT | NULL | 1981-11-17 00:00:00 | 5000.00 | NULL | 10 | | 007844 | TURNER | SALESMAN | 7698 | 1981-09-08 00:00:00 | 1500.00 | 0.00 | 30 | | 007876 | ADAMS | CLERK | 7788 | 1987-05-23 00:00:00 | 1100.00 | NULL | 20 | | 007900 | JAMES | CLERK | 7698 | 1981-12-03 00:00:00 | 950.00 | NULL | 30 | | 007902 | FORD | ANALYST | 7566 | 1981-12-03 00:00:00 | 3000.00 | NULL | 20 | | 007934 | MILLER | CLERK | 7782 | 1982-01-23 00:00:00 | 1300.00 | NULL | 10 | --------------------------------------------------------------------------------mysql select concat(lcase(substring(ename,1,1)), substring(ename,2)) 姓名 from emp; -------- | 姓名 | -------- | sMITH | | aLLEN | | wARD | | jONES | | mARTIN | | bLAKE | | cLARK | | sCOTT | | kING | | tURNER | | aDAMS | | jAMES | | fORD | | mILLER | -------- 4. 数学函数 -- 绝对值 mysql select abs(-10); ---------- | abs(-10) | ---------- | 10 | ----------mysql select abs(10); --------- | abs(10) | --------- | 10 | ----------- 向上取整取比当前大的一方整数 mysql select ceiling(27.01); ---------------- | ceiling(27.01) | ---------------- | 28 | ---------------- mysql select ceiling(-27.01); ----------------- | ceiling(-27.01) | ----------------- | -27 | ------------------- 向下取整取比当前小的一方整数 mysql select floor(27.01); -------------- | floor(27.01) | -------------- | 27 | --------------mysql select floor(-27.01); --------------- | floor(-27.01) | --------------- | -28 | ----------------- format 保留小数位 mysql select format(3.1415926, 2); ---------------------- | format(3.1415926, 2) | ---------------------- | 3.14 | ----------------------mysql select format(3.1415926, 3); ---------------------- | format(3.1415926, 3) | ---------------------- | 3.142 | ---------------------- 5. 其他函数 user() 查询当前用户 mysql select user(); -------- | user() | -------- | root | -------- database()查看当前使用的数据库  mysql select database(); ------------ | database() | ------------ | scott | ------------password()函数MySQL数据库使用该函数对用户加密  mysql select password(root); ------------------------------------------- | password(root) | ------------------------------------------- | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | ------------------------------------------- ifnullval1 val2 如果val1为null返回val2否则返回val1的值  mysql select * from emp; -------------------------------------------------------------------------------- | empno | ename | job | mgr | hiredate | sal | comm | deptno | -------------------------------------------------------------------------------- | 007369 | SMITH | CLERK | 7902 | 1980-12-17 00:00:00 | 800.00 | NULL | 20 | | 007499 | ALLEN | SALESMAN | 7698 | 1981-02-20 00:00:00 | 1600.00 | 300.00 | 30 | | 007521 | WARD | SALESMAN | 7698 | 1981-02-22 00:00:00 | 1250.00 | 500.00 | 30 | | 007566 | JONES | MANAGER | 7839 | 1981-04-02 00:00:00 | 2975.00 | NULL | 20 | | 007654 | MARTIN | SALESMAN | 7698 | 1981-09-28 00:00:00 | 1250.00 | 1400.00 | 30 | | 007698 | BLAKE | MANAGER | 7839 | 1981-05-01 00:00:00 | 2850.00 | NULL | 30 | | 007782 | CLARK | MANAGER | 7839 | 1981-06-09 00:00:00 | 2450.00 | NULL | 10 | | 007788 | SCOTT | ANALYST | 7566 | 1987-04-19 00:00:00 | 3000.00 | NULL | 20 | | 007839 | KING | PRESIDENT | NULL | 1981-11-17 00:00:00 | 5000.00 | NULL | 10 | | 007844 | TURNER | SALESMAN | 7698 | 1981-09-08 00:00:00 | 1500.00 | 0.00 | 30 | | 007876 | ADAMS | CLERK | 7788 | 1987-05-23 00:00:00 | 1100.00 | NULL | 20 | | 007900 | JAMES | CLERK | 7698 | 1981-12-03 00:00:00 | 950.00 | NULL | 30 | | 007902 | FORD | ANALYST | 7566 | 1981-12-03 00:00:00 | 3000.00 | NULL | 20 | | 007934 | MILLER | CLERK | 7782 | 1982-01-23 00:00:00 | 1300.00 | NULL | 10 | ---------------------------------------------------------------------------------- 判断comm是否为NULL,如果是NULL显示0不为NULL显示原本的数字 mysql select ifnull(comm, 0) 奖金 from emp; --------- | 奖金 | --------- | 0.00 | | 300.00 | | 500.00 | | 0.00 | | 1400.00 | | 0.00 | | 0.00 | | 0.00 | | 0.00 | | 0.00 | | 0.00 | | 0.00 | | 0.00 | | 0.00 | ---------
http://www.hkea.cn/news/14357946/

相关文章:

  • 网站推广建设阶段wordpress自建主题
  • 汉鼎中国 网站建设余姚 做网站
  • 如何查企业做网站是否备案过视频发布到哪些平台可以赚钱
  • 大庆免费网站建设公司网站建设布局
  • 织梦网站熊掌号改造怎么做wordpress 幻灯片标签
  • 五星花园网站建设兼职海口网站制作企业
  • 免费的黄冈网站有哪些建筑设计方案
  • 百度做的网站国外可以打开吗中国建筑工程有限公司
  • 京东的网站规划与建设网站建设 骏域网络建设专家广州
  • 燕郊的大型网站建设制作一款app软件大概需要多少费用
  • 做个网站做什么呢wordpress 文章加图片
  • 广州电子商务网站建设费用惠州公司网站建设价格
  • 培训网站设计师东莞网站建设 织梦
  • 中牟高端网站建设天猫网页版
  • wordpress图片间隔东莞seo 公司
  • 灯罩技术支持东莞网站建设个人网站程序下载
  • 烟台网站排名优化公司哪家好wordpress 总数 函数
  • 名师工作室网站建设建议宁阳网页设计
  • 西安北郊网站维护运营好设计购物网站
  • 移动端网站建设的方案建官网公司
  • 成都哪家做网站公司好黄页88网站
  • 腾讯云免费网站建设2018网站建设合同范本
  • 舟山市定海区建设规划局网站商业空间
  • 点对点视频网站开发房地产开发资质
  • 网站开发教程 视频 ssh数据库和网站开发
  • 500云空间网站无锡谷歌推广
  • 做网站接活犯法吗介绍一个电影的网站模板下载
  • 常熟网站制作设计wordpress美化登录
  • c语言做网站吗黄石本土做网站的公司
  • 网站排版的优点中信国际建设公司网站