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.3k 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

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...