I am trying to multiply the existing value with some constant value o.1876. the output of the data is looks like
sales_agg
- 0.01314717
- 1.46E-04
- 0.00236974
- 0.02031013
- 0.01421709
- 0.25651208
- 0.10146865
- 0.00435217
- 0.01827912
- 0.12998486
i just need to mutiply the constant values to existing data and bring to a another column in sql query. tried with Cast Int but no luck. i can ignore the non numeric data in the list and multiply only with proper numeric data.
2
Answers
In AWS Athena SQL, multiplying a constant number with existing data can be achieved using a straightforward query. For example, to multiply a column by a constant, use:
This operation scales the data, allowing for various analytical tasks and insights.
Think of the values in a SELECT as being a formula. You can therefore use: