Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7006909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:32:17+00:00 2026-05-27T21:32:17+00:00

Assuming a table with a column where integers are stored. —————————– id | some_int

  • 0

Assuming a table with a column where integers are stored.

-----------------------------
id    |  some_int  | some_other_value
-----------------------------
1        5           hello
2        9           how
3        987         are
4        5           you
5        9           thanks
6        1           for
7        5           answering. :-)

Is SELECT * FROM mytable ORDER BY some_int; distinct? Meaning will it always return the rows in the same order, after each query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:32:18+00:00Added an answer on May 27, 2026 at 9:32 pm

    To the best of my knowledge if there are duplicates in the order by clause, there is no guarantee for the order in which the duplicates are presented.

    If this is a concern, you could modify the order by to include the primary key (id I am assuming).

    ORDER BY some_int, id
    

    Since id is a primary key, it should also be indexed. Thus the performance difference will be minimal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming I have a SQL Server 2005 table with an xml column containing the
Assuming I have two SQL tables consisting of a single column, i.e. Table 1
Assuming a table of tags like the stackoverflow question tags: TagID (bigint), QuestionID (bigint),
Consider this example table (assuming SQL Server 2005): create table product_bill_of_materials ( parent_product_id int
Assuming an InnoDB table, will the following command ... CHECK TABLE table_name; ... cause
How much data should be in a table so that reading is optimal? Assuming
How can I predict the future size / growth of an Oracle table? Assuming:
I have a select from (nothing to complex) Select * from VIEW This view
I have a mysql table called pollOfTheWeek. It has a column pollDate of type
I was searching for integers in a nvarchar column. I noticed that if the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.