473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Order by clause

If I use the order by clause to sort on a date, where the date and
time stamp are the exact same for multiple records, how does SQL
output the data?
At random... or does it look at the primary key?
Jul 20 '05 #1
1 1527
"Chirag Patel" <ro*******@yahoo.com> wrote...
If I use the order by clause to sort on a date, where the date and
time stamp are the exact same for multiple records, how does SQL
output the data?
At random... or does it look at the primary key?


Generally speaking these behaviors are considered "undefined". As such you
cannot rely on it even if it "appears" to always do the same thing and if
you absolutely need the set ordered then you have to include it in the order
clause.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: M Wells | last post by:
Hi all, Just wondering if anyone can tell me if an order by clause on a select query would have any impact on the time it takes to retrieve results? Essentially I'm selecting Top 1 out of a...
3
by: Blake Caraway | last post by:
All, I've seen several posts regarding using UNION or UNION ALL to mash together two or more resultsets into a single result set, but can't seem to find enough info here to help me answer my...
7
by: JJ_377 | last post by:
Can someone tell me why SQL seems to ignore my order by clause? I tried to run through the debugger, but the debugger stops at the select statement line and then returns the result set; so, I have...
1
by: mailar | last post by:
Hi, Can I use ORDER BY clause in my sql UDF that returns a table and has the folloing body. (trial_udf.sql) drop function aa@ create function aa() returns TABLE(empno varchar(20)) language...
12
by: Jozef | last post by:
Hello, Does anyone here know for sure, when you do a For Each loop on a forms controls collection, does Access cycle through them in Alphabetical order or control ID or ???. Any ideas? ...
26
by: GreatAlterEgo | last post by:
Hi, This is my query which is embedded in a COBOL program. EXEC SQL SELECT DATE, AGE, DURATION, AMT INTO :LDATE, :L.AGE, :L.DURATION, :L.AMT FROM TAB1 WHERE CODE = :KEY.CODE AND...
104
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through...
7
by: mandible | last post by:
Hello I'm trying to have some control on how my data is ordered depending on an input parameter my question is in a stored procedure how can I do something like this at the end of my...
4
by: Yobbo | last post by:
Hi All My query is as follows: SELECT STRINGTEXT, TOKENID FROM WEBSTRINGS WHERE TOKENID IN (6,20,234,19,32,4,800,177) All I want is my resultset to come back in the order that I have...
1
by: 28490 | last post by:
Hi, In 10.2 when a query is run with GROUP BY it does not order the output by the grouped columns. In earlier versions the output was always sorted by the the grouped columns even though there...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.