Home > Database > Mysql Tutorial > body text

How to use distinct() command in MySQL

WBOY
Release: 2023-05-27 10:02:18
forward
1080 people have browsed it

distinct()

Command: distinct

Function: Deduplication

Application scenario: When statistical type, status, and distinction are required .

Example:

mysql> select count(distinct(name))/count(*) from t_base_user;
+--------------------------------+
| count(distinct(name))/count(*) |
+--------------------------------+
|    0.6667 |
+--------------------------------+
1 row in set (0.00 sec)
Copy after login

The above is the detailed content of How to use distinct() command in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
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