HIVE SQL 计算
HIVE SQL Calculation
我需要 HIVE 中小数点后 5 位的答案(store_ratio 需要小数点后 5 位。来源 table 有 total_order 值。
Select Store_number, order_number, (1/total_orders) as store_ratio
From Master_Store_order
尝试使用允许您指定小数位数的round
函数
Select Store_number, order_number, ROUND(1/total_orders,5) as store_ratio From Master_Store_order
我需要 HIVE 中小数点后 5 位的答案(store_ratio 需要小数点后 5 位。来源 table 有 total_order 值。
Select Store_number, order_number, (1/total_orders) as store_ratio
From Master_Store_order
尝试使用允许您指定小数位数的round
函数
Select Store_number, order_number, ROUND(1/total_orders,5) as store_ratio From Master_Store_order