Наверное так будет оптимальнее, хотя к вопросу похоже это не имеет отношения
PHP код:
display Name getCountyName()
{
County county;
State state;
;
return (select firstonly Name from state
where this.state ==state.StateId
join Name from county
where state.StateId == county.StateId).Name;
}