I have a table with set of data. The table data will be as follows.

```
ID | Name | Age
----------------
1  |  A   | 24
2  |  B   | 25
3  |  C   | 30
4  |  D   | 46
5  |  E   | 35
6  |  F   | 26
7  |  G   | 30

```

Now, what I want is to update the age column for certain IDs, so that the end result will be as follows.

```
ID | Name | Age
----------------
1  |  A   | 24
2  |  B   | 22
3  |  C   | 35
4  |  D   | 50
5  |  E   | 27
6  |  F   | 26
7  |  G   | 30 

```

I updated the rows where the ID = 2, 3, 4, 5

How can I achieve this result through a single T-SQL query? This is just a sample table. In real case, it's a table with over 1500 data, so that it consumes a lot of time to update the rows individually.

---

I found a solution, but I can't add it as an answer. So I decided to edit my own question and put the answer. Please refer the below url for more info: 

www.stackoverflow.com/questions/16932526/… 

```
           UPDATE e 
           SET age = t.age 
           FROM table e 
           JOIN ( VALUES 
           (1, 26), 
           (2, 30), 
           (3, 35) ) 
           t (id, age) ON t.id = e.id 

```