By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
(No column name) |
---|
Microsoft SQL Server 2014 (SP3-CU-GDR) (KB4535288) - 12.0.6372.1 (X64) Dec 12 2019 15:14:11 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows NT 6.3 <X64> (Build 17763: ) (Hypervisor) |
8 rows affected
id | employee_id | salary | s_year |
---|---|---|---|
1 | 1 | 18000 | 2005 |
1 | 1 | 16000 | 2002 |
1 | 1 | 12000 | 2001 |
1 | 1 | 10000 | 2000 |
1 | 1 | 8000 | 1999 |
1 | 2 | 10000 | 2001 |
1 | 3 | 14000 | 2006 |
1 | 3 | 12000 | 2004 |
employee_id | new_sal | old_sal | rn |
---|---|---|---|
1 | 18000 | 16000 | 1 |
1 | 16000 | 12000 | 2 |
2 | 10000 | 0 | 1 |
3 | 14000 | 12000 | 1 |