postgresql7.1 select coalesce(initial_response_id,response_id) as initial_response_id from survey_responses where reponse_id=:response_id