Advertisement
juliarnasution

hapus duplikat di postgre dan sql server

Sep 23rd, 2019
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WITH tmp_tabel AS (
  2. SELECT
  3.         nilai1, test_id
  4.         ROW_NUMBER() OVER (
  5.             PARTITION BY
  6.                     test_id
  7.             ORDER BY
  8.                     test_id
  9.      ) row_num
  10.      FROM
  11.         test_null
  12.         WHERE test_id ='1'
  13. )
  14. DELETE FROM tmp_tabel
  15. WHERE row_num > 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement