Для примера запроса в вашем сообщении (и с использованием Oracle 11gR2) вы можете добавить starrating
в качестве дополнительного столбца, используя инструкцию case. Это то, что вы хотели?
select
resort.resortid,
resort.resortname,
review.comments ,
case when starrating between 4.5 and 5.0 then 'Excellent Resort'
when starrating between 4.0 and 4.4 then 'Very Good Resort'
else 'Good Resort'
end as rating
from resort
inner join review
on resort.resortid=review.resortid
;
Чтобы включить значения полей (4,5, 4,0 и c.), Измените ваш SQL как:
select
resort.resortid,
resort.resortname,
review.comments ,
case when starrating >= 4.5 and starrating < 5.0 then 'Excellent Resort'
when starrating >= 4.0 and starrating < 4.4 then 'Very Good Resort'
else 'Good Resort'
end as rating
from resort
inner join review
on resort.resortid=review.resortid
;
SQL скрипка здесь