sql server - How can I update Crate IDs of List of Fruits in single SQL query in c# -


in reference question,

how can update sql table logic

i want query this,

enter image description here

i last question confusing hence asking different question.

how can update crate ids of list of fruits in single sql query in c#

fruitid , crateid foriegn keys , in other tables.

try using in:

update fruits set crate = 'crate 7' fruitid in (1, 2, 3) 

or

update fruits set crate = 'crate 7' fruitname in ('mango1', 'mango2', 'apple 6') 

you can use like match mango , orange may update incorrect results (say want orange 199 updated crate 7 want orange 198 crate 6)


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -