I want to update or replace values in one table. like below:
createtable life_cal
(
project varchar(10),
type varchar(10),
life int
)insertinto life_cal values('a1','house',100)insertinto life_cal values('a1','phone','')insertinto life_cal values('b1','building',120)insertinto life_cal values('b1','phone','')
Results in this data set:
project type life
----------------------
a1 house 100
a1 phone
b1 building 120
b1 phone
I want to get a result like below:
project type life
---------------------
a1 house 100
a1 phone 100
b1 building 120
b1 phone 120
On this above result it is updated based on type. if the type is like HOUSE, BUILDING then replaces/UPDATE the life of the PHONE accordingly base on the project.
It would be great if someone helps me with this. I tried a lot but could not get the correct answer.
Thank you in advance.