Subject | Re: [firebird-support] Strange SELECT FIRST 1 |
---|---|
Author | Ann Harrison |
Post date | 2012-09-12T18:09:46Z |
On Wed, Sep 12, 2012 at 6:18 AM, Mr. John <mr_johnmr@...> wrote:
unique key, you don't need the "FIRST 1". If those fields don't form a
unique key, then your getting one of the rows that match those values at
random. Either drop the "FIRST 1" or add an "ORDER BY" to
get deterministic results.
Good luck,
Ann
[Non-text portions of this message have been removed]
> Hi,I'm using FB 2.5.1.26351 SS on XP SP3,I have one storedThat is an odd statement. If you know that ID_CF and numar combined form a
> procedure,also inside
> FOR EXECUTE STATEMENT loop I have this query
>
> SELECT FIRST 1 id_cf,numar FROM CB_FC WHERE ID_CF=:wid_cf
> AND numar=:wNUMAR INTO :xid_cf,:xnumar;
>
unique key, you don't need the "FIRST 1". If those fields don't form a
unique key, then your getting one of the rows that match those values at
random. Either drop the "FIRST 1" or add an "ORDER BY" to
get deterministic results.
Good luck,
Ann
[Non-text portions of this message have been removed]