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 -> ORDER BY column names vs column numbers

ORDER BY column names vs column numbers

From: Anneke Treep <anneke_at_echelon.nl>
Date: 9 Apr 1999 09:15:41 GMT
Message-ID: <3xvOrducOdpb-pn2-zpdq21djG8uY@compaa.echelon.nl>


Hi All,

I have run into this problem using SQL*Plus: Release 3.3.3.0.0 on an SCO_SV release 3.2v5.0.4 system running Oracle 7.3.3.3.0.

I am selecting some appointments as follows:  SELECT appt.emp1 employee, appt.team1 team, appttime, custno, custname
 FROM various-tables
 WHERE various-criteria
  UNION
 SELECT appt.emp2 employee, appt.team2 team, appttime, custno, custname
 FROM various-tables
 WHERE various-criteria
  ORDER BY 1,2,3,4 This works fine.
But, when instead I use the following:
  ORDER BY employee, team, appttime, custno the ordering on the appttime (and custno?) fields disappears???

I prefer to use column names instead of numbers, but why cant I?

Thanks for any help!
--

Anneke Treep                                 | email:     
anneke_at_echelon.nl
                                             | web:          
www.echelon.nl
ECHELON consultancy and software development | phone: +31 (0)53 48 36 585
PO Box 545, 7500AM Enschede, The Netherlands | fax: +31 (0)53 43 36 222 Received on Fri Apr 09 1999 - 04:15:41 CDT

Original text of this message

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