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,

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
Post a Comment