I've been struggling with a multiple count statement. my table is build like this;
person1, person2, relation
peter ann coworkers
I need to count how many relations peter has under coworker, under lovers . etc etc
I've come up with this;
select(
select count(*)
from rel
where person1 = 'peter' and relation = 'coworker'
)as PetersFriends,(
select count(*)
from rel
where person1 = 'peter' and relation = 'lovers'
)
as PetersLovers
;
but I can't seem to get it to work.