Home  >  Article  >  Database  >  sql注入-mysql duplicate entry

sql注入-mysql duplicate entry

WBOY
WBOYOriginal
2016-06-06 09:40:201129browse

mysqlsql注入数据库

1.对于普通的一张表我们可以对某个字段进行分组,比如对于有username,age,salary,mal e三个字段
的一张表worker,我们可以 select * from worker group by age;,那么会根据age分好组。
2.如果我们 select floor(rand(0)*2)x from worker group by x结果也会被分成0,1两组
3.如果我们想统计每个age组的人数,可以 select age,count(
) from worker group by age;
4.可要是我们想知道rand(0)*2的结果又多少0,多少1,我们 select loor(rand(0)*2)x ,count() from worker group by x;
出现duplicateEntry ,网上找了很久答案都没有结果,网上说是
.然而mysql在内部处理中间结果的时候,出现了意外,导致报错。
我个人觉得并不是字段不唯一呀,当没和count(*)组合在一起的时候也没有问题哈,想请教一下大家为啥组合在一起就出错了呢(这好像也会引起sql注入的问题哈。)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn