SQL Language (MOSC)

MOSC Banner

Any Difference in GroupBy and OrderBy Using Numerals

edited Dec 16, 2010 6:32AM in SQL Language (MOSC) 17 commentsAnswered ✓
 Hi Folks

is there any difference in using numerals for ordering  as opposed to using the names for grouping by or ordering by clauses ?

example 1:

select
   name,
   TO_CHAR (empdate,'yyyy') yeartodate,
from
   table1
group by
   name,
   TO_CHAR (empdate,'yyyy')
order by
   name,
   TO_CHAR (empdate,'yyyy')

example 2:

select
   name,
   TO_CHAR (empdate,'yyyy') yeartodate,
from
   table1
group by
   1,
   2
order by
   1,
   2

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center