我有一个查询,其中一些操作需要等待前一个正确运行,现在我手动一步一步运行,但我想解决这个问题,直接一步运行它。我附上一个例子:提前谢谢
SELECT
[WO],
COUNT(*) as [Count]
FROM [MESF_1].[dbo].[Server]
group by [WO]
ORDER BY [COUNT] DESC
---------------------------------------------------------------------------------------------------
WITH cte AS (
SELECT[WO],
row_number() OVER(PARTITION BY WO order by [WO]) AS [rn],
[WeekDay]
FROM [MESF_1].[dbo].[Server]
)
DELETE cte WHERE [rn] > 1 and [Weekday] is not null
USE [MESF_1]
GO
---------------------------------------------------------------------------------------------------
UPDATE [MESF_1].[dbo].[Server]
SET [Time] = Format ([NOW],'HH:mm:ss')
WHERE [Time] is null
GO
暂无答案!
目前还没有任何答案,快来回答吧!