mysql counting occurrences in a column?

How do you count only certain occurrences in a column and only display those occurrences.

for example:

a 1

b 2

c 2

d 1

I only want to display occurrences of 2. So my result should be:

b

c

I have been on this for a while now and I am starting to bang my head against the table. Please help.

Update:

Where do you reply to this thing? BAD INTERFACE YAHOO!

1 Answer

? Favorite Answer

  • A WHERE clause doesn’t work?

    “select * from mytable where mycolumn = 2;”

  • Leave a Comment