需要在下面计算一个名为 Value 的字段。
: =的
计算逻辑: X0=X1/X2 5/10的计算逻辑0.5Y0Y1/Y2 4/100.4
这是示例数据
ID Cd format Value
1 X1 # 5
2 X0 % 0.5 --this needs to be computed based on X1/X2
3 X2 # 10
4 Y1 # 4
5 Y0 % 0.4 --this needs to be computed based on Y1/Y2
6 Y2 # 10
我如何在 SQL 中编写这个
谢谢!!