开发者

search and count values in column of mysql result set

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜