I have a table like this:
id name discount timestamp
+----+----------+-------------+-----------------+
2 sy 12345 20031141
+----+----------+-------------+-----------------+
3 nt 12345 20031125
+----+----------+-------------+-----------------+
4 zl 14356 20031001
I am selecting matching results between two dates passed in.
Let's say that all the rows above matched the criteria and are returned.
I need to count all the rows that have a matching discount number.
So I could say: 2 of 12345 were returned and 1 of 14356 was returned.
Is there an easy way to count the rows.
I have already done it with loops, but I was just wondering if there was an easy way.