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

Home -> Community -> Usenet -> c.d.o.server -> Re: Strange query result with Order by

Re: Strange query result with Order by

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 25 Nov 2004 14:12:32 -0800
Message-ID: <2687bb95.0411251412.7ab90762@posting.google.com>


christianboivin1_at_hotmail.com (Chris) wrote in message news:<da20daf0.0411250530.4d7a6d3a_at_posting.google.com>...
> Hi all,
>
> First time i see this ... when i run this query :
>
> SELECT hev_annee_deb, hev_annee_fin, hev_id_uef, hev_valeur_t,
> hev_valeur_b,
> NVL (hev_valeur_t, 0) + NVL (hev_valeur_b, 0) valeur_totale,
> HEV_PCT_VARIATION
> FROM HIS_EVAL
> WHERE hev_id_uef = 1449902
> ORDER BY hev_annee_deb DESC
>
> i got 1 row ...
>
> 2002,2002,1449902,23500,84700,108200,
>
> if i remove the descending order ... like this
>
> SELECT hev_annee_deb, hev_annee_fin, hev_id_uef, hev_valeur_t,
> hev_valeur_b,
> NVL (hev_valeur_t, 0) + NVL (hev_valeur_b, 0) valeur_totale,
> HEV_PCT_VARIATION
> FROM HIS_EVAL
> WHERE hev_id_uef = 1449902
> ORDER BY hev_annee_deb
>
> i got 2 row ...
>
> 2001,2001,1449902,23500,61700,85200,
> 2002,2002,1449902,23500,84700,108200,
>
> What's the problem ... ?
> Thanks
> Chris

Chris,
First, what version of Oracle? On what platform? Second, is this repeatable? As shown the result could be due to someone inserting a row and committing it after you first query started. The second query would then show the new row.

HTH -- Mark D Powell -- Received on Thu Nov 25 2004 - 16:12:32 CST

Original text of this message

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