Reputation: 155
I'm trying to get a list of records that have a specific value. I only want it to retrieve however if there's over 10. My current solution
SELECT attr1
FROM table
WHERE attr2 = 'value1'
GROUP BY attr1
HAVING count(*) > 10
There are 12 records that show value1
so in theory, it should show up. It only shows up if I change the count to 9
, is there something wrong with my statement? I've tried adding records but does not work. Thanks
Upvotes: 0
Views: 47
Reputation: 44921
Option 1.
There are no 10 value1 records per attr1
Option 2.
You have white characters in your text.
Use hex(attr2)
to find them
Upvotes: 1