If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Update SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-09-10, 10:39
deshaipet deshaipet is offline
Registered User
 
Join Date: Aug 2008
Posts: 76
Update SQL

Hi Folks,

I would like to update only first 1000 rows of a table. Can anyone help me with the SQL ?

Thanks,
Panditt
Reply With Quote
  #2 (permalink)  
Old 10-09-10, 12:01
Anand.Kaushal Anand.Kaushal is offline
Registered User
 
Join Date: Oct 2010
Posts: 14
fetch first x rows only

this would work..

UPDATE TABLE SET COL = VALUE
WHERE ID IN (SELECT ID FROM TABLE ORDER BY ID FETCH FIRST 1000 ROWS ONLY);
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On