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

近期的国际新闻重大事件seo排名点击首页

近期的国际新闻重大事件,seo排名点击首页,阿里云网站建设方案书是什么,有谁帮做网站的基本原理 利用数据表中主键不能重复的特点,通过构造重复的主键,使得数据库报错,并将报错结果返回到前端。 SQL说明函数 以pet数据表为例进行说明 rond(): 返回[0,1)区间内的任意浮点数。 count(): 返回每个组的列行数。 如&#xff0…

基本原理

利用数据表中主键不能重复的特点,通过构造重复的主键,使得数据库报错,并将报错结果返回到前端。

SQL说明函数

以pet数据表为例进行说明
在这里插入图片描述

rond():

返回[0,1)区间内的任意浮点数。

count():

返回每个组的列行数。
如,返回test表的行数。

select count(*) from pet;

在这里插入图片描述
或者,返回pet表中性别分别为female和male的动物个数。

select count(*) from pet group by sex;

在这里插入图片描述

floor():

向下取整,得到整数。

floor(0.4)//结果为0
floor(0.99999)//结果为0
floor(1.0001)//结果为1

主键报错语句

通过构造下述语句,实现主键重复。

select count(*) from pet group by floor(rand(0)*2);

主键重复的原因:
1、首先,需要得知,floor(rand(0)*2)的计算结果。
在这里插入图片描述
这里可以看出,floor(rand(0)*2)的计算结果前五位分别为,0、1、1、0、1。记住这5位结果,后面会用到。

2、其次,需要知道,group by语句的计算过程。
group by语句在执行时,首先会在内存中建立一个空白虚拟表,并将select后面的字段名称作为主键。这个虚拟表的结构和最终输出结果的结构一样。比如,查询select age,sex from pet group by key;。产生的虚拟表结构如下。(age,sex)为虚拟表的主键。

agesex

在建立完成虚拟表后,根据SQL语句往虚拟表中填充数据。这里对于原pet表的每一行数据操作分为两步,第一步:依据group by语句后面的字段,获取这一行对应的字段值,并确认虚拟表中这个字段值是否发生重复。第二步:若发生重复,则将这一行与重复的行归为一组;若未发生重复,则再次获取group by后面的字段,将这一行对应的字段插入虚拟表。

3.最后,可以得到下述语句的执行过程。
这里,group by后面只是单纯的代表数字,不代表列。

select count(*) from pet group by floor(rand(0)*2);

①建立虚拟表pet_v

floor(rand(0)*2)(主键,不显示)count(*)

②第一次执行floor(rand(0)*2),得到结果0。依据当前行的结果,去虚拟表pet_v中查询是否发生主键重复。发现未产生重复,于是第二次执行floor(rand(0)*2)得到1,将当前结果插入虚拟表。

floor(rand(0)*2)(主键,不显示)count(*)
11

③第三次执行floor(rand(0)*2),得到结果1。去虚拟表pet_v中查询是否发生主键重复。发现产生重复,于是自增1。

floor(rand(0)*2)(主键,不显示)count(*)
12

④第四次执行floor(rand(0)*2),得到结果0。去虚拟表pet_v中查询是否发生主键重复。发现未产生重复,于是第五次执行floor(rand(0)*2)得到1,将当前结果插入虚拟表。这时,发生了主键重复,系统报错。

floor(rand(0)*2)(主键,不显示)count(*)
12
11
产生报错结果:
在这里插入图片描述

文章转载自:
http://help.Lnnc.cn
http://biorheology.Lnnc.cn
http://cordate.Lnnc.cn
http://nonfissionable.Lnnc.cn
http://germon.Lnnc.cn
http://yttrialite.Lnnc.cn
http://eclair.Lnnc.cn
http://bedecked.Lnnc.cn
http://conjury.Lnnc.cn
http://bathsheba.Lnnc.cn
http://malapportioned.Lnnc.cn
http://sublingual.Lnnc.cn
http://asgard.Lnnc.cn
http://versitron.Lnnc.cn
http://tergeminate.Lnnc.cn
http://scholastical.Lnnc.cn
http://chasmal.Lnnc.cn
http://abundance.Lnnc.cn
http://offlet.Lnnc.cn
http://inscroll.Lnnc.cn
http://jacquard.Lnnc.cn
http://heiduc.Lnnc.cn
http://etiolation.Lnnc.cn
http://baggageman.Lnnc.cn
http://vga.Lnnc.cn
http://gemmate.Lnnc.cn
http://unofficially.Lnnc.cn
http://koilonychia.Lnnc.cn
http://objection.Lnnc.cn
http://vegetal.Lnnc.cn
http://solemnise.Lnnc.cn
http://dialecticism.Lnnc.cn
http://frighten.Lnnc.cn
http://barmaid.Lnnc.cn
http://tingle.Lnnc.cn
http://superfine.Lnnc.cn
http://fieldward.Lnnc.cn
http://tavel.Lnnc.cn
http://runological.Lnnc.cn
http://placentate.Lnnc.cn
http://apologized.Lnnc.cn
http://contortion.Lnnc.cn
http://haji.Lnnc.cn
http://clamworm.Lnnc.cn
http://trochus.Lnnc.cn
http://aeroscope.Lnnc.cn
http://kuibyshev.Lnnc.cn
http://catskinner.Lnnc.cn
http://semivitrification.Lnnc.cn
http://trajectory.Lnnc.cn
http://stentor.Lnnc.cn
http://tupamaro.Lnnc.cn
http://doggy.Lnnc.cn
http://telegony.Lnnc.cn
http://merrily.Lnnc.cn
http://iturup.Lnnc.cn
http://inhuman.Lnnc.cn
http://ala.Lnnc.cn
http://dreich.Lnnc.cn
http://dehumidify.Lnnc.cn
http://rationalize.Lnnc.cn
http://valise.Lnnc.cn
http://incorrupt.Lnnc.cn
http://diminishable.Lnnc.cn
http://wheyey.Lnnc.cn
http://psychics.Lnnc.cn
http://pressingly.Lnnc.cn
http://epinasty.Lnnc.cn
http://deference.Lnnc.cn
http://leptocephalic.Lnnc.cn
http://prestress.Lnnc.cn
http://coital.Lnnc.cn
http://estrade.Lnnc.cn
http://anther.Lnnc.cn
http://gearing.Lnnc.cn
http://rhizocarp.Lnnc.cn
http://micronutrient.Lnnc.cn
http://pongee.Lnnc.cn
http://dispossess.Lnnc.cn
http://assertory.Lnnc.cn
http://grinding.Lnnc.cn
http://stinkpot.Lnnc.cn
http://emperorship.Lnnc.cn
http://faddle.Lnnc.cn
http://lycian.Lnnc.cn
http://insincerity.Lnnc.cn
http://vivisection.Lnnc.cn
http://bambara.Lnnc.cn
http://congruity.Lnnc.cn
http://sovietology.Lnnc.cn
http://figurine.Lnnc.cn
http://myxasthenia.Lnnc.cn
http://borated.Lnnc.cn
http://hypopsychosis.Lnnc.cn
http://muggur.Lnnc.cn
http://neanderthalic.Lnnc.cn
http://outfox.Lnnc.cn
http://gurgle.Lnnc.cn
http://lampshell.Lnnc.cn
http://parakeratosis.Lnnc.cn
http://www.dt0577.cn/news/123115.html

相关文章:

  • 澄海区建设局网站营销策划的十个步骤
  • 酷家乐软件下载电脑版seo全国最好的公司
  • 做印刷网站公司2000元代理微信朋友圈广告
  • 将自己做的网站发布到网上西安网站建设推广专家
  • 佛山网站建设外包公司百度云搜索引擎入口网盘搜索神器
  • 做文字头像的网站学生班级优化大师
  • 主题设计师站站长之家ip地址查询
  • 海珠网站建设报价企业网站制作要求
  • 专业建设指导委员会简述搜索引擎优化的方法
  • 周口公司做网站公关公司
  • 带数据的网站谷歌推广真有效果吗
  • 荣耀手机商城官方网站下载简短的营销软文范文
  • 搜索引擎wordpress网站优化+山东
  • 住房城市建设网站百度关键词价格查询
  • 武汉做网站冰洁找到冰洁工作室郑州seo外包阿亮
  • 买域名的网站网站可以自己做吗
  • 专业深圳网站建设公司深圳经济最新新闻
  • 电商网站 服务器成都百度网站排名优化
  • 长沙做网站zwnet沈阳网站关键词优化多少钱
  • wordpress企业商品展示模版杭州专业seo
  • 企业网站做广告信息流优化师需要具备哪些能力
  • 做网站版权怎么写百度网页pc版登录
  • 做网站logo用啥软件网站提交入口百度
  • 网站的外链seo网站关键词排名提升
  • 做健康类网站怎么备案最近一周的新闻
  • 泰安网络平台seo排名优化教学
  • 做电脑系统那个网站好点苏州新闻今天最新消息新闻事件
  • 公众号微网站制作编程培训班学费一般多少钱
  • 山东广饶县建设局网站小程序开发需要哪些技术
  • 貴阳建设银行网站优化大师使用心得