Hello,

I have two tables as below.

I tried to create a query to replace the values of Student.Dept_name from Dept.Dept_Name where there is same Dept_ID.

Here is my query:
UPDATE Student
SET Student.Dept_Name = Dept.Dept_Name
WHERE Student.Dept_ID = Dept.Dept_ID

Dept
Dept_ID Dept_Name
1 A1
2 B1
3 C1
4 A1
5 C1
6 B1

Student
ID Dept_ID Dept_Name
1 2 A
2 3 A
3 2 A
4 1 A
5 3 A

As a result, Student table should have this data after I run the query:
ID Dept_ID Dept_Name
1 2 B1
2 3 C1
3 2 B1
4 1 A1
5 3 C1

I got this error:
The column prefix 'Dept' does not match with a table name or alias name used in the query.

can you help?

Thanks.