Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORDER BY vs MIN to implement FIFO

Re: ORDER BY vs MIN to implement FIFO

From: D Rolfe <dwrolfeFRUITBAT_at_orindasoft.com>
Date: Fri, 25 Jun 2004 07:41:03 +0100
Message-ID: <40DBC8FF.3050607@orindasoft.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US