I’d like to do the following with a sub query, even though I can do it another way. I’m querying a large junction table and inside of that query I want to get a count of all the county names that come up more than X number of times.
select v.id, k.countyName
from v inner join k on v.countyID=k.countyID inner join
icd_jxn on v.id = icd_jxn.id
where k.countyName in
(select count(k.countyName) from k
having count(k.countyName) > 10)
The error given is conversion failed when converting the varchar value X to int. I don’t want to do any conversion, I just want a number of the times the county name appears on the table.

Your inner query is only returning a count. Your query needs to be this: