开发者

search and count values in column of mysql result set

开发者 https://www.devze.com 2023-03-24 19:06 出处:网络
I would like to search and count unique values in a column/fieldname of a MySQL Result Set. In other words, when some lines of one table are stored in a mysql resultset I want to know which values a

I would like to search and count unique values in a column/fieldname of a MySQL Result Set.

In other words, when some lines of one table are stored in a mysql resultset I want to know which values are stored in开发者_开发百科 a specific column/fieldname of all stored lines.


SELECT COUNT(DISTINCT columnname) AS Total FROM yourtable
0

精彩评论

暂无评论...
验证码 换一张
取 消