oracle8.1.6 select nvl(initial_response_id,response_id) as initial_response_id from survey_responses where response_id=:response_id select count(*) from survey_responses where survey_id=:survey_id and survey_response.initial_user_id(response_id)=:user_id and initial_response_id is null