Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Yan_1st_wall
--Sql Server 2014 Express Edition --Batches are separated by 'go' declare @t table ( Id int , section int, time date, value int ); insert into @t values ( 1 , 1 , '2014-01-01', 2), ( 2 , 1 , '2014-01-01', 3), ( 3 , 2 , '2014-01-01', 1), ( 4 , 2 , '2014-01-01', 1), ( 5 , 2 , '2014-01-01', 5), ( 6 , 1 , '2014-02-02', 1), ( 7 , 1 , '2014-02-02', 6), ( 8 , 1 , '2014-02-02', 7), ( 9 , 1 , '2014-02-02', 1), ( 10 , 2 , '2014-02-02', 1), ( 11 , 1 , '2014-03-11', 2), ( 12 , 2 , '2014-03-11', 7), ( 13 , 3 , '2014-03-11', 1), ( 14 , 3 , '2014-03-11', 2), ( 15 , 3 , '2014-03-11', 3); select * from @t; Select Id, time, section, value, ranks from (select Id, time, section, value, Rank() over (partition by time order by value desc) as ranks From @t) T Where ranks < 3;
run
|
edit
|
history
|
help
0
Delete cascade
kuy09:admin09@pkms99.info
Branch
af
SQL
Lab 4
Function to remove pattern occurences in a string
Assignment 1
Manish_Sql_updated
Extracting Id No