Advertisement
AliaksandrLet

Removing identical lines

Mar 19th, 2022 (edited)
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.28 KB | None | 0 0
  1. -- Удаление одинаковых строк в таблице с двумя текстовыми столбцами Name и Surname
  2. WITH cte AS (
  3.     SELECT
  4.         ROW_NUMBER() OVER (PARTITION BY Name, Surname ORDER BY Name) AS RN
  5.     FROM
  6.         dbo.Test
  7. )
  8. DELETE FROM cte WHERE RN > 1;
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement