SQL injection-mysqlduplicateentry

Source: Internet
Author: User
1. for a common table, we can group a field. for example, for a table worker with three fields: username, age, salary, and male, we can select * fromworkergroupbyage ;, the group will be divided according to age. 2. if we select * floor (rand (0) * 2) xfromworkergroupbyx, the result will be divided into two groups, 1 and 3. if we want to count the number of people in each age group, we can select Tage, count (*) fromworkergr... mysqlsql injection database

1. for a common table, we can group a field, for example, three fields: username, age, salary, and mal e.
For a table worker, we can select * from worker group by age; then the group will be divided according to age.
2. if we selectFloor (rand (0) * 2) x from worker group by x results will also be divided into 0, 1 groups
3. to count the number of people in each age group, select age, count (
) From worker group by age;
4. if we want to know the result of rand (0) * 2 0 and 1, we selectLoor (rand (0) * 2) x, count () From worker group by x;
DuplicateEntry appears. after searching for a long time on the Internet, no results are returned.
However, an error occurs when mysql processes intermediate results internally.
I personally don't think the field is not unique. it's okay if it's not combined with count, I would like to ask you why an error occurs when you combine them (this may also cause the problem of SQL injection .)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.