Question

Suppose you have a table in SQL:

Prices
------
13.99
14.00
52.00 
52.00 
52.00 
13.99

How would you count the amount of times a DIFFERENT field has been entered in? Therefore an example of such a count would output:

13.99 - 2 times. 
14.00 - 1 times. 
52.00 - 3 times.

OR perhaps:

3 (i.e. 13.99, 14.00, 52.00)

Can anyone advise? Cheers.

Was it helpful?

Solution

How about:

SELECT Prices, COUNT(*) FROM TheTable GROUP BY Prices

Can't say I've tried it on MySql, but I'd expect it to work...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top