Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> ORDER BY column names vs column numbers
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