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 > Informix > Delete with row counter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-30-05, 07:04
Alpeich Alpeich is offline
Registered User
 
Join Date: Dec 2005
Posts: 1
Delete with row counter

Hi,
I'm trying to write a sql sentence in Informix and Oracle.
I want to erase the first 150000 rows from a table.
The sentence in Oracle is "DELETE FROM [table] WHERE ROWNUM <= 150000", and it works perfectly.
But I can't find a sentence with the same result in Informix.

Anybody have any idea?

Thanks!!!!
Reply With Quote
  #2 (permalink)  
Old 12-31-05, 22:36
June C. Hunt June C. Hunt is offline
Registered User
 
Join Date: Feb 2005
Posts: 43
I hate to do this, but try ROWID (rather than ROWNUM).

The reason I hate to suggest it is because it is not an absolute indicator for the first 150000 records in the table. You make no mention of how much/often the data changes. You don't even mention the version of IDS that you are using. In fact, are you using IDS or Online or SE?

In any case, the simplest answer is to try Rowid. Good luck.
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