我是新到Hive请帮助我,我有一个表名普拉克,我需要找到的产品,使更多的利润(价格成本)比产品鼠标。我尝试了下面的查询,但它不起作用。
select product_name,price-cost
from prac
where price-cost > (select price-cost from prac where product_name='mouse')
我的数据是
id,product_name,product_type,price,cost,date
100,maker,stationary,25,22,2008-01-15
101,mouse,computer,450,350,2009-04-16
102,white board,stationary,450,375,2010-06-25
103,sony viao,computer,35000,42000,2010-09-21
1条答案
按热度按时间wtlkbnrh1#
我知道答案了