SQL Server(T-sql) Update table from botom to top [closed]
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . Improve this question im trying to update table temp(F4) result from bottom to top. Is it while-loop every row and update can be order by? Thanks! 回答1: Assuming ROW is a positive integer then you can use (demo) WITH T1 AS ( SELECT *, MIN(CASE WHEN F4 <> 0 THEN CONCAT(FORMAT([ROW],'D10'),[F4]) END)