Home  >  Article  >  Database  >  How to remove duplicate queries in mysql

How to remove duplicate queries in mysql

coldplay.xixi
coldplay.xixiOriginal
2020-10-10 15:40:409774browse

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

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

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!

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