Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.4k 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)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...