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

网站制作哪个公司好wordpress链接伪静态

网站制作哪个公司好,wordpress链接伪静态,百度收录是什么意思,海外网站seo优化一. DQL DQL:Data Query Language(数据查询语言),用来查询数据库表中的记录。 关键字:SELETE -- DQL 完整语法select字段列表 from表名列表 where条件列表 group by分组字段列表 having分组后条件列表 order by排序字段列表 limit分页参数 …

一. DQL

        DQL:Data Query Language(数据查询语言),用来查询数据库表中的记录。

        关键字:SELETE

-- DQL 完整语法select字段列表
from表名列表
where条件列表
group by分组字段列表
having分组后条件列表
order by排序字段列表
limit分页参数

二. DQL基本查询

-- DQL-基本查询-- 查询多个字段 -- 建议使用
select 字段1, 字段2, 字段3 from 表名;-- 查询所有字段(通配符) 
select * from 表名;-- 为查询字段设置别名,as可以省略
select 字段1 [as 别名1], 字段2 [as 别名2] from 表名;-- 查询去除重复记录
select distinct  字段列表 from 表名;

         注意:* 代表查询所有字段,在实际开发中尽量少用(不直观,影响效率)

-- 查询多个字段 
select name, password from emp;-- 查询所有字段(通配符)
select * from emp;-- 为查询字段设置别名,as可以省略
select name as n, password p from emp;-- 查询去除重复记录
select distinct job from emp;

三. DQL条件查询

-- DQL-条件查询
select 字段列表 from 表名 where 条件列表;

-- 等于 =
select * from emp where name = '泰坦';
-- 小于等于 <=
select * from emp where salary <= 6000;
-- is null为空  is not null不为空
select * from emp where job is null ;
select * from emp where job is not null ;
-- 不等于 != 或 <>
select * from emp where password != '12344';
select * from emp where password <> '12344';
-- between and --between 最小值 and 最大值
select * from emp where entry_date between '2016-01-01' and '2020-01-01';
-- between and 与 多个条件 and
select * from emp where entry_date between '2016-01-01' and '2020-01-01' and gender = '1';
-- or 或者
select * from emp where job = '1' or job = '2' or job = '3';
-- in
select * from emp where job in('1', '2', '3');
-- like (_:单个字符)
select * from emp where name like '__';
-- like (% 任意个字符)
select * from emp where name like '%飞%';

四. DQL分组查询

        聚合函数

                将一列数据作为一个整体,进行纵向计算

         注意:null值不参与所有聚合函数的运算; count(*) 优先推荐使用

-- 聚合函数(所有的聚合函数不参与null的统计)
-- count(字段) 最后推荐使用
select count(id) from emp;
-- count(*) 优先推荐使用
select count(*) from emp;
-- count(常量) 第二推荐使用
select count(1) from emp;-- avg 平均值
select avg(salary) from emp;-- max 最高值
select max(salary) from emp;-- min 最低值
select min(salary) from emp;-- sum 求和
select sum(salary) from emp;

         分组查询

-- 分组查询
select 字段列表 from 表名 [where 条件列表] group by 分组字段名 [having 分组后过滤条件]

        注意:分组之后,select后的字段列表不能随意书写,能写的一般是分组字段+聚合函数 

                执行顺序:where > 聚合函数 > having

        where 与 having的区别:

                (1)  执行时机不同:where是在分组之前进行过滤,不满足where条件则不参与分组;having是在分组之后对结果进行过滤;

                (1) 判断条件不同:where不能对聚合函数进行判断,而having可以

-- 分组查询
-- select 字段列表 from 表名 [where 条件列表] group by 分组字段名 [having 分组后过滤条件]
-- 注意:分组之后,select后的字段列表不能随意书写,能写的一般是分组字段+聚合函数
select gender, count(*) from emp group by gender;select job, count(*) from emp where entry_date <= '2020-01-01' group by job having count(*) >= 2;

五. DQL排序查询

-- 排序查询
select 字段列表 from 表名 [where 条件列表] [group by 分组字段名 having 分组后过滤条件] order by 排序字段 排序方式;

         排序方式:升序(asc)、降序(desc);默认是升序asc;

        注意:如果是多字段排序,当第一个字段值相同时,才会根据第二个字段进行排序

-- 升序
select * from emp order by entry_date asc;
select * from emp order by entry_date;
-- 降序
select * from emp order by entry_date desc ;
-- 多字段排序
select * from emp order by entry_date, update_time desc ;

六. DQL分页查询

-- 分页查询
select 字段 from 表名 [where 条件列表] [group by 分组字段名 having 分组后过滤条件] [order by 排序字段 排序方式] limit 起始索引, 查询记录数;

        1. 起始索引从0开始。

        2. 分页查询是数据库的方言,不同数据库有不同的实现,MySQL中是limit。

        3. 如果起始索引为0,起始索引可以省略,直接简写为 limit 10。

-- 每页展示10条 第一页
select * from emp limit 0,10;
select * from emp limit 10;
-- 每页展示10条 第二页
select * from emp limit 10,10;
-- 每页展示10条 第三页
select * from emp limit 20,10;-- 页码  起始索引 = (页码-1)*起始索引

        

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

相关文章:

  • 个人可以备案网站的内容单页企业网站模板
  • 中国在数码网站注册域名好>石家庄百度推广电话
  • wordpress 关联seo顾问服务公司
  • 深圳专业网站建设公wordpress登录前后菜单
  • 做网站都需要具备什么做博客网站怎么赚钱
  • 一个后台管理多个网站南宁建网站
  • 设计网站名字wordpress付费发布
  • 太原网站制作陕西网络公司
  • 山西品牌网站建设WordPress和phpwind怎么选
  • 河北省建设环境备案网站热点事件舆情分析报告
  • 2018做网站 工具美橙互联 网站备案拍照
  • 网页设计与制作教程考试兰州优化网站
  • 国外设计网站pinterest怎么打不开做牛仔裤的小视频网站
  • 网站鼠标特效网站开发使用哪种工具好
  • 机械加工网站有哪些简单的网站建设方案
  • 网站系统建设方案seo查询工具
  • 做网站 斗地主seo关键词排名优化制作
  • html如何做购物网站天猫网站建设论文
  • 网站开发棋牌英语培训
  • 男男做受网站市场调研报告怎么写的
  • 全国最大的网站建设公司免费网站搭建
  • 网站创建方案论文长沙网站建站
  • 银川建设网站找做网站的公司需要注意什么
  • wap网站浏览器网站的竞品分析怎么做
  • 加强局门户网站建设asp.net网站制作实例
  • 做百家好还是个人网站网站的首页怎么做
  • 温州网站制作设计wordpress站群seo
  • 国外设计网站dooor凡客属于什么档次的品牌
  • 哪个网站系统做的好网络优化行业怎么样
  • 建站公司哪家好 都选万维科技公司运营是做什么的