现在数据如下: 需求如下: 要求 更新 Earnings 表中的Earnings字段 当 Table_2 KPI 大于等于1时 Earinings = KPI* 2000,否则等于 KPI* 1500 1 Update Earnings 2 set Earnings = ( 3 SELECT 4 C Read More
现有数据如上图所示,要求统计出日期相同的Count总数,并且加一列统计前面日期Count的总和 1 SELECT SUM([Count]) AS DayTotal, SUM(SUM([Count])) over (order by [Datetime]) Total, [datetime] FROM Read More