Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sql
IF NOT EXISTS ( select * from sysobjects where name='Book6' and xtype='U' ) CREATE TABLE Book6 ( [Id] INT, [Month] DATETIME, [EmpId] INT, [Money] INT, [Type] NVARCHAR(6) ); INSERT INTO Book6 VALUES (1,'2011-01-01 00:00:00',1001,2000,N'Salary'), (2,'2011-01-01 00:00:00',1002,1500,N'Salary'), (3,'2011-01-01 00:00:00',1003,2500,N'Salary'), (4,'2011-01-01 00:00:00',1001,500,N'Bonus'), (5,'2011-02-01 00:00:00',1001,2000,N'Salary'), (6,'2011-02-01 00:00:00',1002,1500,N'Salary'), (7,'2011-02-01 00:00:00',1002,600,N'Bonus'), (8,'2011-03-01 00:00:00',1002,1800,N'Salary'), (9,'2011-03-01 00:00:00',1004,2000,N'Salary'), (10,'2011-03-01 00:00:00',1005,3500,N'Salary'), (11,'2011-03-01 00:00:00',1006,1800,N'Salary'), (12,'2011-03-01 00:00:00',1006,1200,N'Bonus');
run
|
edit
|
history
|
help
0
manish
SQL_Joins_RankingFunctions
sql_fb
dbray
CTE with recursive
exp7
Arun
remove duplicated rows
gfhrey
STACK