ORDER BY [message #586848] |
Tue, 11 June 2013 05:39  |
 |
mercyjhansi
Messages: 4 Registered: June 2013
|
Junior Member |
|
|
The order by clause i used in insert subquery is not working. its not ordering as per the order mentioned. Why so?
insert into myt2 (WONO,
TASKDESC,
TASKREVNO,
SIGNOFF_MECHNAME,
SIGNOFF_INSPNAME,
MEC_LICENCENO,
MEC_REMARKS,
TASKSTATUS,
MEC_SIGNOFFSTATUS,
MAINTTYPE,
MEC_SIGOFFDATE,
INS_LICENCENO,
INS_SIGOFFDATE,
TASKNO,
INS_SIGNOFFSTATUS,
WORKCENTER,
SUBTASK,
INS_REMARKS)
select WONO,
TASKDESC,
TASKREVNO,
SIGNOFF_MECHNAME,
SIGNOFF_INSPNAME,
MEC_LICENCENO,
MEC_REMARKS,
TASKSTATUS,
MEC_SIGNOFFSTATUS,
MAINTTYPE,
MEC_SIGOFFDATE,
INS_LICENCENO,
INS_SIGOFFDATE,
TASKNO,
INS_SIGNOFFSTATUS,
WORKCENTER,
SUBTASK,
INS_REMARKS from myt1 order by WORKCENTER,WONO,TASKNO
|
|
|
|
|
|
|
|
|
|
Re: ORDER BY [message #586858 is a reply to message #586856] |
Tue, 11 June 2013 06:16   |
cookiemonster
Messages: 13972 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
No. Index organized table is a special type of table, not just a table with an index on it. Look it up in the documentation.
I doubt you need it though.
You need to understand that rows in a normal table are not stored in any particular order, and they don't need to be.
IOT is a special case that's used for certain performance issues.
So unless there is a particular performance issue you are trying to solve, stop worrying about the order records are inserted in.
|
|
|
|
Re: ORDER BY [message #586860 is a reply to message #586856] |
Tue, 11 June 2013 06:17   |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
Why does the data need to be stored in a certain order when you can SELECT... ORDER BY? Oracle doesn't guarantee the "order" of data in a table.
|
|
|
|
|
Re: ORDER BY [message #587121 is a reply to message #587118] |
Wed, 12 June 2013 10:48   |
 |
Michel Cadot
Messages: 68770 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
What is the relation between ROWID and "order by WORKCENTER,WONO,TASKNO"?
Regards
Michel
[Edit: Gee! cookiemonster answered the question before I posted it]
[Updated on: Wed, 12 June 2013 10:49] Report message to a moderator
|
|
|
|