-4

Hi I have a table data as below

Now i want to update Department column data of "DA" to "DATA ANALYTICS".
How can i write single update query to update the data?

7
  • I want to update all department column data consisting "DA" to "DATA ANALYTICS" in a single query. Help me with this Commented Jan 7, 2021 at 12:25
  • What have you tried that does not work ? Commented Jan 7, 2021 at 12:26
  • That's a very simple update with a where - what have you got so far? Commented Jan 7, 2021 at 12:27
  • i have to write 7 update queries to update.for example - update emp set 'department'='DATA ANALYTICS' where pk_id = 1; so on. But is it possible to do with single query Commented Jan 7, 2021 at 12:30
  • 'i have to write 7 update queries' - errm no.. Commented Jan 7, 2021 at 12:34

2 Answers 2

1

Try this , Thanks

UPDATE emp SET department='DATA ANALYTICS' WHERE department='DA'
GO
Sign up to request clarification or add additional context in comments.

2 Comments

Go is a sqlserver thing , mysql statement should be semi colon (;) terminated and this is a copy of a previous answer.
GO is not T-SQL no, but it is SQL Server related, @Squirrel . No one said it was T-SQL.
1

The statement would look like this

UPDATE your_table_name
SET Department= 'DATA ANALYTICS'
WHERE Department='DA';

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.