How to update multiple rows in a single column in sql | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How to update multiple rows in a single column in sql

I want to update multiple rows in a single column ex-update <table name>set department=clerk, analyst where empoyeeid=1,2

28th May 2022, 6:07 PM
Raj Kiran
1 Answer
0
If you are using SQL Server, then maybe the CHOOSE function would help: update <table name> set department=CHOOSE(employeeid, 'clerk', 'analyst') where empoyeeid in (1,2)
28th May 2022, 7:09 PM
Brian
Brian - avatar