Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

Currently, I am having the following MySQL table: Employees (empID, empName, department);

I want to change the table to the following: Employees (empID, department, empName);

How can this be done using ALTER statements?

Note: I want to change only column positions.

1 Answer

0 votes
by (40.7k points)

If you want the syntax for using an alias in an update statement on SQL server, then use the code as follows:

Query:

UPDATE Q

SET Q.TITLE = 'TEST'

FROM HOLD_TABLE Q

WHERE Q.ID = 101;

Note: Although alias is not mandatory to use here.

Related questions

0 votes
1 answer
asked Dec 27, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
asked Jul 24, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...