>Sir, how to use your codes in sqlserver management studio?
>
>
In SQL Server you need to move the FROM part to the end. I cannot test it here because I don't have SQL Server installed, but I believe it looks like the following:
UPDATE Junk Set max_qty = 1
From Junk Join (SELECT MAX(qty) as qty, Idid FROM Junk Junk2 GROUP BY Idid) Junk_Max ON Junk.qty = Junk_Max.qty AND Junk.Idid = Junk_Max.Idid
In MySQL and VFP the From part goes after the Update.
Christian Isberner
Software Consultant