我在表中有两列,我正在尝试计算效果最低的列与该列中每个单元格之间的差异。
Private Sub ActiveDocment_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
If (ContentControl.Type = wdContentControlDate) Then
MsgBox "Let's do it! Write the tide levels"
dateObj = ActiveDocument.SelectContentControlsByTag("tide-level")
dateObj.Range.Text = "wwwoohooo Tide Levels!"
Cancel = True
End If
End Sub
我正在尝试获得如下输出
Column_a column_B
abc 1
DEF 5
GHI 7
JKL 8
b列中的每个单元格与min(b列)之间的Column_c差异
答案 0 :(得分:2)
尝试一下。
SELECT Column_a , Column_b,
Column_b- (SELECT MIN(Column_b) FROM your_table) AS Column_c
FROM Your_table
答案 1 :(得分:0)
使用窗口功能:
select column_a, column_b, (column_b - min(column_b) over ())
from t;