oracle8.1.6 select p.key, p.value, decode(e.config_id, d.default_config_id, 1, 0) as default_config_p from portal_element_parameters p, portal_elements e, portal_datasources d where e.datasource_id = d.datasource_id and e.config_id = p.config_id and e.element_id = :element_id