Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Delete double entries from a table without primary key
create table tbl (id int, lastprice float, updatetime time, updatems int); insert into tbl VALUES (211709,51370.,'09:30:00',0), (211709,51370.,'09:30:01',0),(211709,51370.,'09:30:01',500), (211709,51370.,'09:30:02',0),(211709,51370.,'09:30:02',0),(211709,51370.,'09:30:03',0),(211709,51370.,'09:30:04',0), (211709,51370.,'09:30:04',300),(211709,51370.,'09:30:04',300); SELECT * from tbl; DELETE seq FROM (SELECT ROW_NUMBER() OVER(PARTITION BY id, updatetime ORDER BY id, updatetime, updatems ASC) AS RowNum FROM tbl ) seq where rownum>1; SELECT * FROM tbl
run
|
edit
|
history
|
help
0
practice sql_12AUG_Upddated
ms sql where ,like
Pana la ex 8, inclusiv
Get amount of users that bought something soon after registration
Insert index into Temporary Table
employee table
9.12.2020
aawrish
Employee database
TUAN 6 QUANLYDETAI