-
row order of a select result
Hello,
In the same database, we performed a copy of a schema (exp/imp fromuser1 touser2).
One of our developer noticed that he has a result not ordered in the same way when he execute the same statement (a jointure beteween tow tables). I asked him to you ORDER BY to garantee the same order ... But I would like to know more about the order of a select statement (in our case, we have the same result, and I think that rows were inserted in the same order ...).
Thanks a lot in advance
-
Basically, never ever ever ever make any assumptions whatsoever about the order of rows in a table. Period. I don't have a specific answer for you because there are way too many variables. An ORDER BY is the ONLY way to guarantee the order of results. DRILL that into that developer's head until they bleed .
'nuff said,
- Chris
-
As a precaution you should give your developer an ol' fasioned beat down, just to be safe.
If you are using the same query against the 2 environments than either one environment has changed or you may have taken the export from the wrong instance. I know I have never done that
MH
I remember when this place was cool.
-
If you are using the same query against the 2 environments than either one environment has changed or you may have taken the export from the wrong instance. I know I have never done that
One thing i have never done is to query two different databases, with different data in them, and been baffled when the queries returned the same data, only to find later on that I had actually logged into the same database twice. Never never never.
-
Well, having 12 development instances on one NT box, I can say that I have taken exports from the wrong instance and imported it into the right one. Darn the SET ORACLE_SID= command. It can be compounded when you have 2 or three going on at once too.
Been there done that.
Always good to double check!
MH
I remember when this place was cool.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|