I have a table that looks like this
fID_a fID_b
1 1
1 2
2 2
3 1
I want all fID_a where fID_b is 1 AND where fID_a is a single record in that table.
I have a sql query that looks like this
select fID_a from tbl
where fID_b = 1
group by fID_a
having count(*) = 1
But that query still includes the fID_a 1 even though there are 2 records in that table!