Home » SQL & PL/SQL » SQL & PL/SQL » Default sorting order
Default sorting order [message #195545] Fri, 29 September 2006 07:31 Go to next message
dude4084
Messages: 221
Registered: March 2005
Location: Mux
Senior Member
Hi
i want to know about the default sorting order commnad if there is any.

Let me tell you the situation and my requriement.

In a table, the user has entered the product as follow:


Product-2
Product-4
Product-5
Product-1
Product-2


I required this output

Product-2
Product-2
Product-4
Product-5
Product-1

This output is based on the requirment that:
"Group together similar products keeping the orgianl order".


Any comments/help?

Thank you

Re: Default sorting order [message #195546 is a reply to message #195545] Fri, 29 September 2006 07:40 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Quote from the Documentation
order_by_clause
Use the ORDER BY clause to order rows returned by the statement. Without an order_by_clause, no guarantee exists that the same query executed more than once will retrieve rows in the same order

So, unless there is a column that records the order that the rows were added in (a sequence based primary key, or a created date), then you can't do what you want I'm afraid.
Re: Default sorting order [message #195551 is a reply to message #195545] Fri, 29 September 2006 07:50 Go to previous message
dude4084
Messages: 221
Registered: March 2005
Location: Mux
Senior Member
thank you for guiding me.
Previous Topic: Exception Handling
Next Topic: PLS-00306: wrong number or types of arguments in call
Goto Forum:
  


Current Time: Mon Dec 05 02:29:50 CST 2016

Total time taken to generate the page: 0.04814 seconds