select case
when p.property_type ='APARTMENT_COMMUNITY'
then (select fp.bedroom_count
from floor_plans fp
where fp.removed = false
and fp.property_id=p.id)
else (select pu.bedroom_count
from property_units pu
where pu.removed = false
and pu.property_id=p.id)
end
from properties p
where p.id =550
I have this,bedroom_count is not a single row,so it gives this error
ERROR: more than one row returned by a subquery used as an expression
I need to get that result in that case is there any other solution for this?