thank you,Bruce.

I seached the docs for "LIMIT" keyword ,and find it only support Postgresql  
"select top 5 xxx from xxx"  means, for example,there are 20 objects in the persistent 
media, but I  only want to 
retrieve the last 5 objects from it.
So ,now, I use OQLQuery to retrieve all 20 objects, copy the 5 objects to another 
collection,and then close the OQLQuery.
If there are a lot of records in the RDBMS, the action may cost much. 

Notyy

----- Original Message ----- 
From: Bruce Snyder <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 04, 2002 1:06 AM
Subject: Re: [castor-dev] how to get "Top" number objects from database?


> This one time, at band camp, notyy said:
> 
> n>hi,all
> n>    I am trying to use oql go get "top 5" records from database,something like 
>"select top 5 xxx from xxx" in sql ,
> n>        but I don't know how to do so.
> n>    can anybody help me ? thank you very much.
> 
> I'm not exactly sure what you mean by the top five records. I'm
> guessing you are looking for the LIMIT keyword. You'll need to see
> if your database supports it. The LIMIT keyword allows resultsets
> to be limited to the scope you provide.
> 
> Bruce
> --
> 
> perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
> 
> 
> 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to