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

销售公司怎么做网站网络营销和网站推广的区别

销售公司怎么做网站,网络营销和网站推广的区别,知名做网站哪家好,北京住房和城乡建设厅网站首页单表查询 所有的查找都会得到一张虚拟表 一、 最简单的查询 SELECT 123; SELECT asd; SELECT 11;二、 从表中获取数据 select 字段名,字段名 from 表名 2.1 全字段查询 SELECT sid,sname,birthday,ssex,classid FROM student; SELECT * FROM student; -- 使用*不利于s…

单表查询

所有的查找都会得到一张虚拟表

一、 最简单的查询
SELECT 123;
SELECT 'asd';
SELECT 1+1;
二、 从表中获取数据
select 字段名,字段名 from 表名 
2.1 全字段查询
SELECT sid,sname,birthday,ssex,classid FROM student;
SELECT * FROM student;     -- 使用*不利于sql优化,不推荐
2.2 部分字段查询
SELECT sname,ssex FROM student;
2.3 字段名起别名
select sname as '姓名',birthday '生日', ssex 性别 from student;
2.4 添加字段
select sname,'yjy' 学校 from student
2.5 distinct
-- 所有的字段的数据要一致才会去重select distinct sid,sname,ssex from student
2.6 带条件的查询
(1)where 子句过滤查询结果,以仅返回满足特定条件的记录
select * from student where sid=5;
select * from student where sid<>5;
select * from student where sid>5;
select * from student where sid between 3 and 6;
示例:
-- 查找1班的女同学select * from student where classid=1 and ssex='女';-- 查询 年龄 大于1990-1-1 的学生select * from student where birthday < '1990-1-1';
(2)in 在某个特定的范围
-- 3  5  7  9
-- or 会让索引失效select * from student where sid = 3 or sid = 5 or sid = 7 or sid = 9;
-- 推荐 
-- in 可以用到索引select * from student where sid in(3,5,7,9)
(3)like 模糊查询模糊符号:a. % 任意多的任意字符b. _ 一个任意字符
insert into student(sname) values('杨佳佳'),('小杨'),('杨同学');insert into student(sname) values('帅气的杨同学');select * from student where sname like '%杨%'select * from student where sname like '杨%'select * from student where sname like '%杨'select * from student where sname like '杨_'select * from student where sname like '杨__'   -- 两个下划线
(4)null
select * from student where birthday is nullselect * from student where birthday is not null
2.7 聚合函数
把多个值变为一个值a.count() 统计个数b.max() 求最大值c.min() 求最小值d.sum() 求总和e.avg() 求平均数
-- count 不统计null
-- select count(字段\常量\*) from 表名select count(sid) from student;	-- 主键select count(classid) from student;	-- 不统计nullselect count('a') from student;		-- 不推荐select count(1) from student;	-- 推荐select count(*) from student;	-- 推荐
-- sum avg min max  数值类型select sum(score) from sc;select avg(score) from sc;select max(score) from sc;select min(score) from sc;
示例:
-- 统计出成绩表中一共有多少次考试,总成绩,平均分,最高分,最低分select count(*),sum(score),avg(score),max(score),min(score) from sc;
2.8 分组 group by
对所有的数据进行分组统计,分组的依据字段可以有多个,并依次分组
-- 统计各班有多少人select classid,count(1) from student group by classid -- 成绩表 统计每个同学的 总分和平均分select sid,sum(score),avg(score) from sc group by sid
2.9 having
与group by结合使用,进行分组后的数据筛选
-- 查询平均分不及格的sidselect sid ,sum(score),avg(score) from sc group by sid having avg(score) < 60
2.10 order by 排序
(1)按照先写的字段排序,如果有相同的按照下一个字段排序
(2)升序 asc(默认)
(3)降序 desc 必须声明
示例:
select * from student order by classid desc;	-- desc:降序
select * from student order by classid asc; -- asc:升序
select * from sc order by score desc,cid desc;
2.11 limit 分页

0 开始 (页码-1)*步长,步长

-- select * from student limit 位置,步长select * from student limit  6,3-- 应用层解决
-- select * from student limit (3-1)*3,3  错误的-- 找到成绩及格的总分数排名第二的  select sid,sum(score) from sc where score>=60 group by sid  order by sum(score) desc limit 1,1
http://www.ds6.com.cn/news/117462.html

相关文章:

  • 广州网站建设菲利宾网上推
  • 图片模板网站昆明网络推广公司排名
  • 临沂网站建设公司招聘营销策划方案ppt范文
  • 做网站百度收录新闻网最新消息
  • 济南做外贸的网站公司吗seo引擎搜索网站
  • 公司网站建设北京天津百度优化
  • 城乡建设招投标网站如何做网址
  • 免费 网站 服务器2021谷歌搜索入口
  • 自动化营销网站建设专业的网页制作公司
  • 网站建设推广襄樊semester
  • 佛山 做网站百度一下官网首页百度
  • 怎么让人搜索到自己做的网站重庆seo的薪酬水平
  • 小网站推广百度服务中心官网
  • z怎么做优惠券网站株洲seo优化
  • 回老家做PHP网站刷关键词要刷大词吗
  • 网站自建女生学网络营销这个专业好吗
  • 前端自己做博客网站关键词排名靠前
  • 黄山做网站全球网络营销公司排行榜
  • 台州市建设项目规划网站百度关键词优化排名技巧
  • 以家乡为主题做网站平台广告推广
  • 好听的平台名字大全seo顾问服务公司站长
  • 兼职做网站设计兰州seo推广
  • 资料下载网站建设广州seo推广优化
  • 汉中做网站电话口碑营销案例
  • 网络推广外包想手机蛙软件夫唯老师seo
  • 网站建设 中企动力宜昌公司网站模板设计
  • 网站建设需要提供功能目录吗2022千锋教育培训收费一览表
  • 西安网站建设网晨雨中国最新军事新闻
  • 网站怎么做需要花钱吗全网营销网络推广
  • wordpress 复制网站广东东莞最新情况