I have two tables of scores of student:
The Fields of the two table like:

Table1:StID, Math, Nature


Table2: StID, GradeID, Math, Nature

When I update the sore in Table1 form Table2 where Table2.GradeID=2


Update Table1 set Table1.Math=(Select Math from Table2 where
Table2.StID=Table1.StID and Table2.GradeID=2;

Update Table1 set Table1.Nature=(Select Nature from Table2 where
Table2.StID=Table1.StID and Table2.GradeID=2;

Can I do that just as one SQL?

Re: Can we update two fields from other table at a time by Pauly

Pauly
Thu Sep 01 18:38:17 CDT 2005

UPDATE Table1 SET Table1.Math=Table2.Math, Table1.Nature=Table2.Nature
FROM Table1, Table2
WHERE Table1.StID=Table2.StID AND Table2.GradeID=2

Pauly T
www.eMembersOnline.com