Update with Select Query
Posted: Wed Mar 03, 2004 3:32 am
I have Two tables in my POSTGRES DATABASE,
1. Student
2. Library_Student_Info
I want to Join the two tables and Update the 'Library_Student_Info' table with matched records. I am using the following Query
UPDATE Library_Student_Info SET Name = (
SELECT Name
FROM Student WHERE Student_ID= Library_Student_Info.Student_ID
LIMIT 1);
Anybody Can Help me ???
And also this i tried but Error..
UPDATE Library_Student_Info EM SET Name = (SELECT Name FROM Student DIR WHERE
DIR.Student_ID = EM.Student_ID AND
EM.Student_ID IS NOT NULL)
1. Student
2. Library_Student_Info
I want to Join the two tables and Update the 'Library_Student_Info' table with matched records. I am using the following Query
UPDATE Library_Student_Info SET Name = (
SELECT Name
FROM Student WHERE Student_ID= Library_Student_Info.Student_ID
LIMIT 1);
Anybody Can Help me ???
And also this i tried but Error..
UPDATE Library_Student_Info EM SET Name = (SELECT Name FROM Student DIR WHERE
DIR.Student_ID = EM.Student_ID AND
EM.Student_ID IS NOT NULL)