if you mean that a product offer has EITHER a merchant OR a seller, but never both, then this query should do it for you:
Code:
select po.*, coalesce(m.name, s.sellername) as name
from product_offers po
left join product_offers_merchant m on
m.merchantid = po.merchantid
left join product_offers_seller s on
s.sellerid = po.sellerid
but if a product_offer can have both (or none) then you will need this:
Code:
select po.*, m.name as merchantname, s.sellername as sellernamename
from product_offers po
left join product_offers_merchant m on
m.merchantid = po.merchantid
left join product_offers_seller s on
s.sellerid = po.sellerid
Bookmarks