Home > SQL Development > how i can update only certain records within a table

how i can update only certain records within a table



<i><b>Originally posted by : Simon Parry (simon@cbox.co.uk)</b></i><br /><br />Can somebody tell me how i can update only certain records within a table. For example<br /><br />i have a table Customerid, product, reserved<br />the reserved field is either (yes/no)<br /><br />a customer has the option of reserving a batch of products, i.e 7 products, i need to find a way of just updating 7 records instead of them all for a particular customer.<br /><br />this is the statement i am using at the moment<br /><br />UPDATE numbers<br />SET reserved ='Yes' , Customerid =custno<br />WHERE type = 'bannana', reserved ='No'<br /><br />this updates all of the records

    
Guest


<i><b>Originally posted by : Ramesh.B (ramesh_bhanu@yahoo.com)</b></i><br />Use can Use The SET ROWCOUNT 7 FOr The Purpose<br /><br />Like,<br /><br />SET ROWCOUNT 7<br />UPDATE numbers<br />SET reserved ='Yes' , Customerid =custno<br />WHERE type = 'bannana', reserved ='No'<br />SET ROWCOUNT 0<br /><br /><br />------------<br />Simon Parry at 10/13/2000 4:40:40 AM<br /><br /><br />Can somebody tell me how i can update only certain records within a table. For example<br /><br />i have a table Customerid, product, reserved<br />the reserved field is either (yes/no)<br /><br />a customer has the option of reserving a batch of products, i.e 7 products, i need to find a way of just updating 7 records instead of them all for a particular customer.<br /><br />this is the statement i am using at the moment<br /><br />UPDATE numbers<br />SET reserved ='Yes' , Customerid =custno<br />WHERE type = 'bannana', reserved ='No'<br /><br />this updates all of the records

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved