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

网站首页tdk怎么做seo博客网址

网站首页tdk怎么做,seo博客网址,自己做的网站怎么上传到浏览器,视频一页网站怎么做基础查询语句 完整语法格式如下: select 字段列表 from 表名列表 where 条件列表 group by 分组字段 having 分组之后的条件 order by 排序 limit 分页限定 -- 创建表 create table stu(id int,name varchar(20),chinese double,english double,math double ); --…

基础查询语句

完整语法格式如下:
select
字段列表
from
表名列表
where
条件列表
group by
分组字段
having
分组之后的条件
order by
排序
limit
分页限定

-- 创建表
create table stu(id int,name varchar(20),chinese double,english double,math double
);
-- 插入记录
insert into stu(id,name,chinese,english,math) values(1,'tom',89,78,90);
insert into stu(id,name,chinese,english,math) values(2,'jack',67,98,56);
insert into stu(id,name,chinese,english,math) values(3,'jerry',87,78,77);
insert into stu(id,name,chinese,english,math) values(4,'lucy',88,NULL,90);
insert into stu(id,name,chinese,english,math) values(5,'james',82,84,77);
insert into stu(id,name,chinese,english,math) values(6,'jack',55,85,45);
insert into stu(id,name,chinese,english,math) values(7,'tom',89,65,30);
# 1.最简单的查询,查询所有; *代表所有的列;
select * from stu;
# 2.查具体的列名,则select后面直接跟列名;
select id,name,english from stu;
# 3.去除重复数据; 针对后面多个列,完全相同的时候,去除重复数据;
-- select DISTINCT 列名  from 表名;
select DISTINCT name  from stu;
# 4.ifnull,原因在于英语为null,在mysql里面null+其他数据=null
# ifnull(参数1,参数2) 如果参数1有值,则有参数1;如果参数1位null,则走参数2;
# 查询id,name,总成绩
select id,name,(chinese+ifnull(english,0)+math) from stu;
-- mysql会将 字符串'123'转成数字123,再和100加,加完之后是223
SELECT '123' + 100;
-- 'abc'不能转为数字,只输出100;
SELECT 'abc' + 100;
-- null+数据=null
select null+100;
# 5.别名机制;
# 5.1 列的别名;列名 as '别名'
select id as '编号',name as '姓名', chinese as '语文成绩' from stu;
# 5.2 可以省略as
select id  '编号',name  '姓名', chinese  '语文成绩' from stu;
# 5.3 单引号省略
select id  编号,name  姓名, chinese  语文成绩 from stu;
# 5.4 给表加别名; 一般用在多个表查询的时候,或表名 比较长的情况;mydbstudentscore
select s.id,s.`name`,s.chinese from stu s;
# 5.5 函数可以加别名;
select CURRENT_DATE() 当前日期;

where条件语句查询

-- 创建表
CREATE TABLE stu1 (id int,name varchar(20),age int,sex varchar(5),address varchar(100),math int,english int
);
-- 插入记录
INSERT INTO stu1(id,NAME,age,sex,address,math,english) VALUES 
(1,'马云',55,'男','杭州',66,78),
(2,'马化腾',45,'女','深圳',98,87),
(3,'马景涛',55,'男','香港',56,77),
(4,'柳岩',20,'女','湖南',76,65),
(5,'柳青',20,'男','湖南',86,NULL),
(6,'刘德华',57,'男','香港',99,99),
(7,'马德',22,'女','香港',99,99),
(8,'德玛西亚',18,'男','南京',56,65);# 1.查询数学成绩>60分的学生信息;
select * from stu1 where math>60;
# 2.查询年龄不等于20的学生信息;
select * from stu1 where age<>20;
select * from stu1 where age!=20;
# 3.查询年龄在20到45之间的人员信息;
select * from stu1 where age>=20 && age<=45;
select * from stu1 where age>=20 and age<=45;
# 3.2 BETWEEN and方式; BETWEEN 小值 and 大值; 
select * from stu1 where age BETWEEN 20 and 45;
select * from stu1 where age BETWEEN 45 and 20;
# 4.地址是杭州或香港 或南京人员信息
# or ;not in/ in(集合)
select * from stu1 WHERE address='杭州' or address='香港' or address='南京';
select * from stu1 WHERE address='杭州' || address='香港' || address='南京';
select * from stu1 where address in('杭州','香港','南京');
select * from stu1 where address not in('杭州','香港','南京');
# 5.查询英语没考试的人员信息;english null,在mysql里面null不是0;
-- 对于null的数据,不能用=,也不是0
select * from stu1 where english is null;
# 6.模糊查询,like,比较常用;%:表示多个字符;
-- 6.1 查询所有姓马的人员信息;
select * from stu1 where name like '马%';
-- 6.2 查询所有以‘华’结尾的人员信息;
select * from stu1 where name like '%华';
-- 6.3 查询所有名字包含‘德’字的人员信息;
select * from stu1 where name like '%德%';
-- 6.4 查询所有以‘德’开头的人员信息,且名字长度为4的人员;
select * from stu1 where name like '德___';

ordery by排序

-- 创建表
CREATE TABLE stu2 (id int,name varchar(20),age int,sex varchar(5),address varchar(100),math int,english int
);
-- 插入记录
INSERT INTO stu2(id,NAME,age,sex,address,math,english) VALUES 
(1,'马云',55,'男','杭州',66,78),
(2,'马化腾',45,'女','深圳',98,87),
(3,'马景涛',55,'男','香港',56,77),
(4,'柳岩',20,'女','湖南',76,65),
(5,'柳青',20,'男','湖南',86,NULL),
(6,'刘德华',57,'男','香港',99,99),
(7,'马德',22,'女','香港',99,99),
(8,'德玛西亚',18,'男','南京',56,65),
(9,'唐僧',25,'男','长安',87,78),
(10,'孙悟空',18,'男','花果山',100,66),
(11,'猪八戒',22,'男','高老庄',58,78),
(12,'沙僧',50,'男','流沙河',77,88),
(13,'白骨精',22,'女','白虎岭',66,66),
(14,'蜘蛛精',23,'女','盘丝洞',88,88);
# 1.按照年龄进行排序; 默认升序
select * from stu2 ORDER BY age; 
select * from stu2 ORDER BY age asc; 
select * from stu2 ORDER BY age desc; 
# 2.按照年龄先降序排序,数学成绩升序排列 ;
SELECT * from stu2 order by age desc,math asc;
# 3.针对所有的成绩做降序排列;
select name,(math+ifnull(english,0)) from stu2 
order by (math+english) desc;
-- 也可以使用别名进行排序;
select name,(math+ifnull(english,0)) 总成绩 from stu2 
order by 总成绩 desc;
-- 只查性别为男的人员信息的总成绩排序
select name,(math+ifnull(english,0)) 总成绩 from stu2 
where sex='男'
order by 总成绩 desc;

在这里插入图片描述


文章转载自:
http://wanjiadecimator.xnLj.cn
http://wanjiastarlight.xnLj.cn
http://wanjiaantipodal.xnLj.cn
http://wanjiahypomotility.xnLj.cn
http://wanjiaawedness.xnLj.cn
http://wanjiarecoupment.xnLj.cn
http://wanjiabiologic.xnLj.cn
http://wanjiarutabaga.xnLj.cn
http://wanjiaseizin.xnLj.cn
http://wanjiaudo.xnLj.cn
http://wanjiamantel.xnLj.cn
http://wanjiacoliseum.xnLj.cn
http://wanjiahuggermugger.xnLj.cn
http://wanjiabelong.xnLj.cn
http://wanjiagunslinging.xnLj.cn
http://wanjiagonfalon.xnLj.cn
http://wanjiacandida.xnLj.cn
http://wanjiaexhilarant.xnLj.cn
http://wanjiasonglike.xnLj.cn
http://wanjiagemological.xnLj.cn
http://wanjiacinemagoer.xnLj.cn
http://wanjiakathi.xnLj.cn
http://wanjiaslurp.xnLj.cn
http://wanjiacoalite.xnLj.cn
http://wanjiaperonism.xnLj.cn
http://wanjiagraiae.xnLj.cn
http://wanjiaregis.xnLj.cn
http://wanjiapernik.xnLj.cn
http://wanjiasubordinating.xnLj.cn
http://wanjiageorama.xnLj.cn
http://wanjiahoroscope.xnLj.cn
http://wanjiaincorporator.xnLj.cn
http://wanjiaindoctrinate.xnLj.cn
http://wanjiatransvest.xnLj.cn
http://wanjialaudanum.xnLj.cn
http://wanjianoctambulation.xnLj.cn
http://wanjiacounseling.xnLj.cn
http://wanjiajurisdictional.xnLj.cn
http://wanjiajoyless.xnLj.cn
http://wanjiawetproof.xnLj.cn
http://wanjiastowp.xnLj.cn
http://wanjiamonastery.xnLj.cn
http://wanjiahemotherapy.xnLj.cn
http://wanjiajockeyship.xnLj.cn
http://wanjiawiten.xnLj.cn
http://wanjiasynsemantic.xnLj.cn
http://wanjiaartifactitious.xnLj.cn
http://wanjiafoehn.xnLj.cn
http://wanjiakeelage.xnLj.cn
http://wanjiadogmatize.xnLj.cn
http://wanjialadybird.xnLj.cn
http://wanjiayounker.xnLj.cn
http://wanjiaseparatory.xnLj.cn
http://wanjiatarp.xnLj.cn
http://wanjiaqanat.xnLj.cn
http://wanjiaselcouth.xnLj.cn
http://wanjiaauxochrome.xnLj.cn
http://wanjiacongressperson.xnLj.cn
http://wanjiapalaeethnology.xnLj.cn
http://wanjiathowless.xnLj.cn
http://wanjiaanywise.xnLj.cn
http://wanjiajealousness.xnLj.cn
http://wanjiacomandante.xnLj.cn
http://wanjiaextremal.xnLj.cn
http://wanjiaspherule.xnLj.cn
http://wanjiacannonball.xnLj.cn
http://wanjiacurite.xnLj.cn
http://wanjialongicaudal.xnLj.cn
http://wanjianis.xnLj.cn
http://wanjiacosovereignty.xnLj.cn
http://wanjiahypercapnia.xnLj.cn
http://wanjiadebridement.xnLj.cn
http://wanjiadispiritedly.xnLj.cn
http://wanjiapundit.xnLj.cn
http://wanjiachanceless.xnLj.cn
http://wanjiafeedway.xnLj.cn
http://wanjiaerasion.xnLj.cn
http://wanjiadisillusionize.xnLj.cn
http://wanjiadibasic.xnLj.cn
http://wanjiaimpalpable.xnLj.cn
http://www.15wanjia.com/news/122508.html

相关文章:

  • 手机网站开发屏幕尺寸一般是多少百度网盘官网入口
  • 免费新建网站北京计算机培训机构哪个最好
  • wordpress 做大型网站上海网站排名seo公司
  • 美国做按摩广告的网站mac蜜桃923色号
  • 北京pk10网站建设网站开发的步骤
  • 以什么主题做网站好免费创建网站平台
  • 站外营销有哪几种主流方式自助建站系统破解版
  • 网站建设南沙推广计划怎么做推广是什么
  • 做搜狗网站网站推广软件排名
  • wordpress 登录很慢百度搜索引擎优化详解
  • WordPress 网站成本国外常用的seo站长工具
  • 做美女网站流量十大免费最亏的免费app
  • 云南网站建设一条龙建站平台哪个好
  • 中国监理建设协会网站公众号软文素材
  • ppt的网站导航栏怎么做的php免费开源crm系统
  • 网站制作开发教程百度自媒体注册入口
  • 宁波seo外包aso应用优化
  • 专门做潮搭的网站海外推广代理商
  • 公司注册资金实缴可以取出来吗宁波seo推广平台
  • wordpress建站用什么意思线下推广有哪几种渠道
  • 有哪些做政府网站的相关公司常见的网络营销工具
  • 公司建设内容是什么网络优化是做啥的
  • wordpress调用post手机优化软件下载
  • 做阿里巴巴网站图片大全手机如何制作自己的网站
  • 网站的风格主要包括天津seo标准
  • 公司注册费用与流程新站seo外包
  • 中国水利建设网站西安百度代运营
  • 兰州seo外包公司seo研究中心
  • 惠普网站建设的目标锦绣大地seo官网
  • 网站广告如何做neotv