row order of a select result
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: row order of a select result

  1. #1
    Join Date
    Feb 2003
    Posts
    23

    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

  2. #2
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    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
    Christopher R. Long
    ChrisRLong@HotMail.Com
    But that's just my opinion. I could be wrong

  3. #3
    Join Date
    Jan 2001
    Posts
    3,131
    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.

  4. #4
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    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.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  5. #5
    Join Date
    Jan 2001
    Posts
    3,131
    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
  •  



Click Here to Expand Forum to Full Width