Subject Order by does not work if joined upon a stored procedure?
Author mmenaz
FireBird RC2 (IBO + QuickDesk)
Hi, I would like to know why the following query does not return in a ordered dataset, while the other, omitting the join, does! I've also tried the syntax "order by 1", but with no luck! I'm very surprised, maybe I'm forgetting something obvious... maybe...
Thanks a lot
Marco Menardi

---- this does NOT order ----
-----------------------------
SELECT MOVCON_RIGHE.RIGA_CONTABILE_ID,
MOVCON_RIGHE.MOVCON_ID,
MOVCON_RIGHE.CONTO_ID,
MOVCON_RIGHE.PERSONALE,
MOVCON_RIGHE.DESCRIZIONE,
SEL_CODICI_CONTABILI.OUT_DESCRIZIONEDISP AS COD_CONT_DESCRIZIONE
FROM MOVCON_RIGHE
INNER JOIN SEL_CODICI_CONTABILI('ALCY', '000000') ON (SEL_CODICI_CONTABILI.OUT_CODICE_ID = MOVCON_RIGHE.CONTO_ID)
WHERE MOVCON_RIGHE.MOVCON_ID=:MOVCON_ID
ORDER BY MOVCON_RIGHE.RIGA_CONTABILE_ID

But this does!
---------------
SELECT MOVCON_RIGHE.RIGA_CONTABILE_ID,
MOVCON_RIGHE.MOVCON_ID,
MOVCON_RIGHE.CONTO_ID,
MOVCON_RIGHE.PERSONALE,
MOVCON_RIGHE.DESCRIZIONE
FROM MOVCON_RIGHE
WHERE MOVCON_RIGHE.MOVCON_ID=:MOVCON_ID
ORDER BY MOVCON_RIGHE.RIGA_CONTABILE_ID