Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
blah
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
CREATE TABLE Table1 ([col1] varchar(5), [col2] int, [col3] int, [col4] int, [col5] int, [col6] int, [col7] int) ; INSERT INTO Table1 ([col1], [col2], [col3], [col4], [col5], [col6], [col7]) VALUES ('john', 1, 1, 1, 1, 1, 1), ('john', 1, 1, 1, 1, 1, 1), ('sally', 2, 2, 2, 2, 2, 2), ('sally', 2, 2, 2, 2, 2, 2), ('sally', 2, 2, 2, 3, 2, 2) ; SELECT * FROM dbo.Table1 ;WITH CTE AS( SELECT [col1], [col2], [col3], [col4], [col5], [col6], [col7], RN = ROW_NUMBER()OVER(PARTITION BY col1 , col2 , col3 , col4 , col5 , col6 , col7 ORDER BY col1) FROM dbo.Table1 ) DELETE FROM CTE WHERE RN > 1 SELECT * FROM dbo.Table1
View schema
Execution time: 0,02 sec, rows selected: 8, rows affected: 7, absolute service time: 0,2 sec, absolute service time: 0,2 sec
edit mode
|
history
col1
col2
col3
col4
col5
col6
col7
1
john
1
1
1
1
1
1
2
john
1
1
1
1
1
1
3
sally
2
2
2
2
2
2
4
sally
2
2
2
2
2
2
5
sally
2
2
2
3
2
2
col1
col2
col3
col4
col5
col6
col7
1
john
1
1
1
1
1
1
2
sally
2
2
2
2
2
2
3
sally
2
2
2
3
2
2