I have aTable. aTable has the following records:
+----+------+------------------+--------+
| No | Name | Date(mm/dd/yyyy) | Salary |
+----+------+------------------+--------+
| 1 | Ed | 04/01/2016 | 1000 |
| 2 | Tom | 04/02/2016 | 1500 |
+----+------+------------------+--------+
How about the SQL Server query to produce these results to other table:
+----+------+------------------+--------+---+
| No | Name | Date(yyyy/mm/dd) | Salary | k |
+----+------+------------------+--------+---+
| 1 | Ed | 04/01/2016 | 1000 | 0 |
| 2 | Tom | 04/02/2016 | 1500 | 0 |
+----+------+------------------+--------+---+
and update when duplicate key. The primary key is No and Name