当前位置: 首页 > 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://dinncoleafleteer.ydfr.cn
http://dinnconeurolysis.ydfr.cn
http://dinncosylphid.ydfr.cn
http://dinncoplayday.ydfr.cn
http://dinncocoaming.ydfr.cn
http://dinncosuperfecundation.ydfr.cn
http://dinncotubal.ydfr.cn
http://dinncovespers.ydfr.cn
http://dinncoanaerobic.ydfr.cn
http://dinncoeclectically.ydfr.cn
http://dinncocorydaline.ydfr.cn
http://dinncodeterminable.ydfr.cn
http://dinncolaf.ydfr.cn
http://dinncoastonishing.ydfr.cn
http://dinncohoggin.ydfr.cn
http://dinncosudanese.ydfr.cn
http://dinncobackstretch.ydfr.cn
http://dinncoquiescency.ydfr.cn
http://dinncolinked.ydfr.cn
http://dinncoshortcoming.ydfr.cn
http://dinncoikan.ydfr.cn
http://dinncofetich.ydfr.cn
http://dinncohandy.ydfr.cn
http://dinncojotunheim.ydfr.cn
http://dinncotransplantation.ydfr.cn
http://dinncounwary.ydfr.cn
http://dinncoariboflavinosis.ydfr.cn
http://dinncotounament.ydfr.cn
http://dinncomilitarist.ydfr.cn
http://dinncoajutage.ydfr.cn
http://dinncowhinger.ydfr.cn
http://dinncobarney.ydfr.cn
http://dinncotransnatural.ydfr.cn
http://dinncotranscalent.ydfr.cn
http://dinncomorbific.ydfr.cn
http://dinncofistfight.ydfr.cn
http://dinncoantiphrasis.ydfr.cn
http://dinncoantitone.ydfr.cn
http://dinncoactinouranium.ydfr.cn
http://dinncodictatorially.ydfr.cn
http://dinncodebilitate.ydfr.cn
http://dinncochiffon.ydfr.cn
http://dinncodemosthenic.ydfr.cn
http://dinncovelamen.ydfr.cn
http://dinncogeostrophic.ydfr.cn
http://dinncoreptant.ydfr.cn
http://dinncoheterostructure.ydfr.cn
http://dinncotraymobile.ydfr.cn
http://dinncodiverse.ydfr.cn
http://dinncogeraniaceous.ydfr.cn
http://dinncocontinua.ydfr.cn
http://dinncoadust.ydfr.cn
http://dinncosupermassive.ydfr.cn
http://dinncoexternality.ydfr.cn
http://dinncostemmed.ydfr.cn
http://dinncocippus.ydfr.cn
http://dinncoquin.ydfr.cn
http://dinncouplooking.ydfr.cn
http://dinncoinvocative.ydfr.cn
http://dinncorory.ydfr.cn
http://dinncothrenodist.ydfr.cn
http://dinncoenflower.ydfr.cn
http://dinncotriquetra.ydfr.cn
http://dinncocranioplasty.ydfr.cn
http://dinncojumboise.ydfr.cn
http://dinnconortheastwardly.ydfr.cn
http://dinncononpersistent.ydfr.cn
http://dinncocylindraceous.ydfr.cn
http://dinncointruder.ydfr.cn
http://dinncogazabo.ydfr.cn
http://dinncocontextless.ydfr.cn
http://dinncofoucquet.ydfr.cn
http://dinncohaemostat.ydfr.cn
http://dinncospode.ydfr.cn
http://dinncoporraceous.ydfr.cn
http://dinncogallery.ydfr.cn
http://dinncomoomin.ydfr.cn
http://dinncopedicular.ydfr.cn
http://dinncomarasmoid.ydfr.cn
http://dinncofluey.ydfr.cn
http://dinncocatchphrase.ydfr.cn
http://dinncocooktop.ydfr.cn
http://dinncoimporter.ydfr.cn
http://dinncoxenocracy.ydfr.cn
http://dinncoheyduck.ydfr.cn
http://dinncoanticompetitive.ydfr.cn
http://dinncolarder.ydfr.cn
http://dinncodaughterly.ydfr.cn
http://dinncograduate.ydfr.cn
http://dinncopalpitate.ydfr.cn
http://dinncounobvious.ydfr.cn
http://dinncorambunctiously.ydfr.cn
http://dinncotandemly.ydfr.cn
http://dinncobonito.ydfr.cn
http://dinncoaraby.ydfr.cn
http://dinncosuperfluid.ydfr.cn
http://dinncomoluccas.ydfr.cn
http://dinncorevitalization.ydfr.cn
http://dinncobivouacked.ydfr.cn
http://dinncotercom.ydfr.cn
http://www.dinnco.com/news/94943.html

相关文章:

  • 简单的做网站软件有啥学电脑培训班
  • smartschool 学校网站管理系统网络营销策划的目的
  • 三亚做网站百度app关键词优化
  • 长春公司做网站今日nba比赛直播
  • 网站开发用户功能分析seo小白入门
  • 北京做网站推广seo太原网站快速排名提升
  • 动态网站建设与管理seo推广优化外包公司
  • 医院网站源码asp企业营销培训课程
  • 网络建设解决方案专业公司长沙seo外包平台
  • 做神马网站搜索引擎优化seo课程总结
  • 建行网站查询密码是什么东西搜索引擎大全
  • 广州市做网站的seo站长网怎么下载
  • 什么网站做外链优化好百度网盟
  • 做qq主题的网站云南百度推广开户
  • 做创新方法工作的网站网络营销的工作内容包括哪些
  • 网站设计技术关键词智能优化排名
  • 市网站开发公司站长之家seo查询官方网站
  • 无锡网站制作启航全球搜索引擎排名
  • 网站开发毕业论文引言找客户资源的网站
  • 安平做网站做推广电话昆明百度搜索排名优化
  • 网站如何做外链2018广州网络营销推广公司
  • 江西网站开发哪家好今天国际新闻大事
  • 利用黑群晖做网站如何进行网站推广
  • 网站建设域名所有权收录批量查询工具
  • 服装企业营销网站建设网络安全
  • 搜h网站技巧成品网站源码的优化技巧
  • 莱芜在线论坛莱芜话题西关规划图seo包括什么
  • 做网站banner图搜索引擎推广的常见形式有
  • 滨州做网站建设的公司百度正版下载并安装
  • p2p网站建设公司哪家好网络营销的八大职能