I think you meant:
select profile.name
from profile,attribute
where ( profile.id = attribute.containerId) and ( profile.state =' 1020811' or ( attribute.name = 'marketsegment'
and attribute.value = '1020704');
> select profile.name from profile,attribute where
> ((profile.state='1020811') or ((attribute.name='marketsegment') and
> (attribute.value='1020704') and (profile.id=attribute.containerId)));
>
> Why doesn't this last query return just one row?
>
> TIA
>