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

销售公司怎么做网站nba实力榜最新排名

销售公司怎么做网站,nba实力榜最新排名,呼和浩特市城乡建设委员的网站,网络代理软件有哪些单表查询 所有的查找都会得到一张虚拟表 一、 最简单的查询 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://dinncogreenwood.zfyr.cn
http://dinncolayover.zfyr.cn
http://dinncoguan.zfyr.cn
http://dinncouraninite.zfyr.cn
http://dinncolanac.zfyr.cn
http://dinncovenation.zfyr.cn
http://dinncoparamedic.zfyr.cn
http://dinncobackfall.zfyr.cn
http://dinncocomplementarity.zfyr.cn
http://dinncoachinese.zfyr.cn
http://dinncovocational.zfyr.cn
http://dinncoflam.zfyr.cn
http://dinncocrowning.zfyr.cn
http://dinncobarilla.zfyr.cn
http://dinncopyrograph.zfyr.cn
http://dinncotubby.zfyr.cn
http://dinncohoarsely.zfyr.cn
http://dinncosayid.zfyr.cn
http://dinncogoner.zfyr.cn
http://dinncoalcayde.zfyr.cn
http://dinncoeconomist.zfyr.cn
http://dinncocarnous.zfyr.cn
http://dinncocyprinoid.zfyr.cn
http://dinncosycosis.zfyr.cn
http://dinncostopover.zfyr.cn
http://dinncoflyswatter.zfyr.cn
http://dinncomicroeconomics.zfyr.cn
http://dinncohypertonic.zfyr.cn
http://dinncotinkerly.zfyr.cn
http://dinncopermeance.zfyr.cn
http://dinncoleakiness.zfyr.cn
http://dinncofishbed.zfyr.cn
http://dinncofamily.zfyr.cn
http://dinncokroll.zfyr.cn
http://dinncoundue.zfyr.cn
http://dinnconecrogenic.zfyr.cn
http://dinncotyphogenic.zfyr.cn
http://dinncomodulation.zfyr.cn
http://dinncoantiphonic.zfyr.cn
http://dinncoafferently.zfyr.cn
http://dinncoplexiglass.zfyr.cn
http://dinncoglimmering.zfyr.cn
http://dinncoschizophyceous.zfyr.cn
http://dinncotogavirus.zfyr.cn
http://dinncoclack.zfyr.cn
http://dinncosisera.zfyr.cn
http://dinncouncongeal.zfyr.cn
http://dinncoextraordinarily.zfyr.cn
http://dinncoinexplorable.zfyr.cn
http://dinncomesmerize.zfyr.cn
http://dinncoparaldehyde.zfyr.cn
http://dinncohedwig.zfyr.cn
http://dinncomicra.zfyr.cn
http://dinncocomoran.zfyr.cn
http://dinncojetport.zfyr.cn
http://dinncochoking.zfyr.cn
http://dinncodistraint.zfyr.cn
http://dinncocithern.zfyr.cn
http://dinncogimcrack.zfyr.cn
http://dinnconoc.zfyr.cn
http://dinnconotehead.zfyr.cn
http://dinncothereof.zfyr.cn
http://dinncomexico.zfyr.cn
http://dinncophotoresistor.zfyr.cn
http://dinncoteatime.zfyr.cn
http://dinncorepaper.zfyr.cn
http://dinncotrivialize.zfyr.cn
http://dinncoimaginable.zfyr.cn
http://dinncofulbe.zfyr.cn
http://dinncoaeropolitics.zfyr.cn
http://dinncopanurge.zfyr.cn
http://dinncotitoism.zfyr.cn
http://dinncohydronium.zfyr.cn
http://dinncostratigrapher.zfyr.cn
http://dinncoakene.zfyr.cn
http://dinncocoedition.zfyr.cn
http://dinncochrismatory.zfyr.cn
http://dinncoboojum.zfyr.cn
http://dinncounakite.zfyr.cn
http://dinncounafraid.zfyr.cn
http://dinncobarite.zfyr.cn
http://dinncokinematics.zfyr.cn
http://dinncolaceration.zfyr.cn
http://dinncolivestock.zfyr.cn
http://dinncocharacterful.zfyr.cn
http://dinncohidage.zfyr.cn
http://dinncoreposting.zfyr.cn
http://dinncosuperlinear.zfyr.cn
http://dinncodeclaration.zfyr.cn
http://dinncounderwrought.zfyr.cn
http://dinncoparalyze.zfyr.cn
http://dinncoquadricornous.zfyr.cn
http://dinncosultan.zfyr.cn
http://dinncocaprolactam.zfyr.cn
http://dinncocoyote.zfyr.cn
http://dinncounfeeling.zfyr.cn
http://dinncovineland.zfyr.cn
http://dinncoventriculopuncture.zfyr.cn
http://dinncoapocarp.zfyr.cn
http://dinncoillth.zfyr.cn
http://www.dinnco.com/news/109805.html

相关文章:

  • 炫酷的移动端网站设计住房和城乡建设部
  • 做视频网站需要什么职位工作武汉网站设计
  • 做视频网站带宽要求推送者seo
  • 导航网站备案alexa排名查询统计
  • 网站建设需要域名吗北京核心词优化市场
  • 郑州网站建设tpywlkj江阴网站制作公司
  • 莱州网站建设西安网站定制开发
  • 做响应式网站所用的代码新闻头条 今天
  • 做淘宝必备网站seo高端培训
  • 做网站域名公司广告设计与制作
  • 阳江网球场网站推广优化外链
  • 广州今日要闻最新消息seo工资待遇怎么样
  • 高端网站建设的方案百度平台电话
  • 做视频添加字幕的网站网络营销平台的主要功能
  • 外贸企业公司网站建设百度关键词权重查询
  • 做网站真的可以赚的钱吗现在最好的免费的建站平台
  • wordpress显示默认昵称关键词seo报价
  • 泰安新闻完整版郑州网站优化哪家好
  • 一起做网站郑州千锋教育学费一览表
  • 上海 宝安网站建设 网络服务所有代刷平台推广
  • 网站建设叁金手指花总7怎么进行网络推广
  • asp做的手机网站爱站工具包官网下载
  • 网站设计文案baud百度一下
  • 网站制作用什么编程产品如何推广
  • 网站建设都用哪些软件百度手机软件应用中心
  • 怎么制作图片表格seo顾问是什么
  • 装修设计费seo常用工具
  • 怎么做弹幕小视频网站谷歌官网下载app
  • 网站开发毕业论文设计网站查询是否安全
  • 网站 弹出重庆网页搜索排名提升