>>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.
Sir your codes works in sqlserver management studio but it takes long time to update table.
I think the query of Sir Rick Hodgin will work fine because I have tested his previous query that works with great speed.
Thand and regards