Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ORDER BY vs MIN to implement FIFO
Saeed wrote:
> A table holds data of jobs. Some are waiting to be actioned. A query is
> required to pull out the the one that has been in this stae the longest.
> The two options are:
>
> SELECT job_id FROM jobs WHERE status = 'W' ORDER BY job_id
>
How do you know that job_id's are handed out in sequence? If they aren't the above query won't work 100% of the time. Don't think that using a SEQUENCE guarantees that the numbers will be sequential- unique yes, sequential not always if you have multiple users.
David Rolfe
Orinda Software
Dublin, Ireland
Received on Fri Jun 25 2004 - 01:41:03 CDT