日期:2014-05-17 浏览次数:20597 次
select grocery_item, PRICE_IN_2000, ESTIMATED_PRICE_IN_2025, ROUND((ESTIMATED_PRICE_IN_2025/PRICE_IN_2000-1)*100,2) ||'%' as "MY OUTPUT" from grocery_prices where ESTIMATED_PRICE_IN_2025/PRICE_IN_2000=(select max(ESTIMATED_PRICE_IN_2025/PRICE_IN_2000) from grocery_prices) --加一句
------解决方案--------------------
-->try select top 1 grocery_item, PRICE_IN_2000, ESTIMATED_PRICE_IN_2025, ROUND((ESTIMATED_PRICE_IN_2025/PRICE_IN_2000-1)*100,2) ||'%' as "MY OUTPUT" from grocery_prices order by ROUND((ESTIMATED_PRICE_IN_2025/PRICE_IN_2000-1)*100,2) desc
------解决方案--------------------
单纯你的问题,用1楼的可以了,如果你想从你那个语句着手,那要改成这样:
select grocery_item, PRICE_IN_2000, ESTIMATED_PRICE_IN_2025, ROUND((ESTIMATED_PRICE_IN_2025/PRICE_IN_2000-1)*100,2) ||'%' as "MY OUTPUT" from grocery_prices where "MY OUTPUT">=Any( select max((ESTIMATED_PRICE_IN_2025/PRICE_IN_2000-1)*100)||'%' from grocery_prices);