Click here to Skip to main content
16,004,479 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have table A like…
Id Parameter Weight
1 1 10
1 2 20
1 3 30
1 4 40
2 1 Null
2 2 Null
2 3 Null
2 4 Null

Update Null value details using parameter value and id?
Posted
Updated 25-Feb-15 1:05am
v2

update [tablename] set weight = 123 where [Id] = 2 and [Parameter] = 1
 
Share this answer
 
If i understood you correctly you want to update TABLE A->Weight column which currently has null values to other value based on Id and Parameter criteria.

If this is what you want then you can use below SQL

SQL
UPDATE <table_name>
SET  WEIGHT = <SOME_VALUE>
WHERE ID = 2
AND   PARAMTER IN (1, 2, 3 , 4)
WHERE WEIGHT IS NULL
 
Share this answer
 
v2
Hi,

Check this

SQL
Update tableA set Weight=10--(required Value) 
where id=2--(required Id)
and parameter=1--(required Parameter)


Hope this will help you.

Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900