简体   繁体   中英

Count the number of unique data in a table

I have a table in a database that stores the name of each User who accessed my application in PHP. I would like to make a function that calculates the number of unique users who accessed it so far (assuming a User can access it more than once). However, I have no idea how to make this count .

要计算唯一身份用户的数量,您可以

SELECT COUNT(DISTINCT `column_name`) FROM `table_name`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM