sql - Does 'Select' always order by primary key? -
A basic simple question to all of you for DBA.
When I make a selection, is it always a guarantee that the primary key of my result will be ordered, or should I specify it with 'order by'?
I am using Oracle as your DB.
No, if you do not use "order by", then you guarantee any order Do not give up. In fact, you are not guaranteed that orders from one query to the next will be the same. Remember that SQL is working with data in a set based fashion. Now, one might have to implement a database implementation or some other order in a certain way, but you should not trust him.
Comments
Post a Comment