Query Select a.name, a.company_no, a.contact_person, a.off_address, a.state_id, a.office_telephone, a.office_fax, a.email, a.website, b.business_type, c.company_logo, c.about from company_details a, company_product b, userinfo c where userid= '135' and a.mrepc_no = b.mrepc_no AND (a.not_active IS NULL OR a.not_active = 0) and b.mrepc_no = c.mrepc_no failed