I have usernames with upper and lower case: Example:
how to count this values in order to have the amount (count) in this case should be: 4 and not 8
SELECT
username,
COUNT(*)
FROM
usertable
GROUP BY
username
您可以使用LOWER
将所有名称转换为相同的大小写,然后计算DISTINCT
值:
COUNT(DISTINCT LOWER(username))
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.