Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a top operator for informix like there is in SQL Server?

I want to run a delete that will just delete the top say 1000 records based on a ordered select.

e.g.

delete from table 
 where id in (select top 1000 id from table order by date desc)
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Yes. Use the FIRST clause with the select statemen

http://publib.boulder.ibm.com/infocenter/idshelp/v117/index.jsp?topic=/com.ibm.sqls.doc/ids_sqs_0984.htm

share|improve this answer
    
Thanks. although it turns out i dont have an informix database. It seems like i have a variant that doesn't have "FIRST". Still, cheers mate! –  rumz Oct 25 '10 at 18:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.