我有这个工作查询
SELECT MIN([DealerCode])
,[201309]
,RowNum = Row_Number() OVER(Order By [201309])
,Rnk = RANK() OVER(ORDER BY [201309])
,DenseRnk = DENSE_RANK() OVER(ORDER BY [201309])
,NTile4 = NTILE(100) OVER(ORDER BY [201309])
,BM = RANK() OVER(ORDER BY [201309])*0.7
FROM [SA_Sew].[dbo].[Sew_YTD_Composite$]
where Ratio_ID = 'fi02u' AND DealerCode like '%VW%'
GROUP BY [201309];
我如何能够将 NTile4 计算作为一个字段,以便能够在 Where 字段中使用它?NTile4 = 70 是基准,我只需要查看基准。
谢谢!