- 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 Resposta
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