Assuming that the lead_master table has a PK called leadmasterid, I think this is what you are after:
UPDATE lead_master SET Assigned_User='m' WHERE leadmasterid IN (SELECT TOP 5 leadmasterid FROM lead_master WHERE Call_Status='b') On 7/22/06, NEHA N <[EMAIL PROTECTED]> wrote: > i have a problem with my query, i have to > update a field based on a condition selected n number from top.i am using > sqlserver2000. > for eg > > UPDATE lead_master SET Assigned_User='m' FROM (SELECT TOP 5 * FROM > lead_master WHERE Call_Status='b') > its not working but the condition i wanted is the above query. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:6/messageid:2518 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
