Home > Database > Mysql Tutorial > How to remove duplicate queries in mysql

How to remove duplicate queries in mysql

coldplay.xixi
Release: 2020-10-10 15:40:40
Original
9792 people have browsed it

Mysql method to remove duplicate queries: 1. Use distinct, the code is [select distinct name from a where statesign=0]; 2. Use group by, the code is [statesign=0 group by.].

How to remove duplicate queries in mysql

Mysql method to remove duplicate queries:

1: Use distinct

select distinct name from a where statesign=0
Copy after login

to query the table Name field in a, remove duplicate records

2: Use group by

select name from a where statesign=0 group by name
Copy after login

to query the name field in table a, group it, remove duplicate records

Related Learning recommendation: mysql video tutorial

The above is the detailed content of How to remove duplicate queries in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template