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 4256472
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:21:30+00:00 2026-05-21T05:21:30+00:00

I have a table (several actually) that I want to get results from with

  • 0

I have a table (several actually) that I want to get results from with the most recent entries first. Here are my ORDER BY clause options:

  • date_created INT (never changes value)
  • id (INT AUTO_INCREMENT of course!)

Both columns should equally represent the order in which the records were inserted. I naturally would use the date_created field like any sane person would, but I’m still curious about this.

I know this is probably splitting hairs, but is there any reason or edge case why I should NOT use the id column?

EDIT: I’m thinking that this question is vague as to which value we want to truly represent the insert order. Thank you for all your answers everybody, I am going to accept the best one and move on because I think I have made this difficult by assuming that ids will always be in order (see @Wrikken’s comment). My gut instinct is that id should never be considered by the developer, which is what most of the answers here are pointing to.

  • 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-21T05:21:31+00:00Added an answer on May 21, 2026 at 5:21 am

    It isn’t a good idea to depend on the ID column for time ordering, because that isn’t its purpose. Basically, the ID is just a unique key for that row, nothing more. Using ID might never cause problems, but there is no reason to add complexity of assuming that ordering by ID will always hold. For instance, you might in the future want to delete entries and then manually insert new entries, or import entries from some other source that are timestamped in the past. If you didn’t have a date_created column, then ID would be your only option, but since you have the column, use it, as it is your best choice.

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

Sidebar

Related Questions

I have a table (several actually) that contain a lot of columns (maybe 100+).
Weird to describe but here goes. I have a table with several rows. One
I have a partitioned table that belongs to tablespace report . I want to
I have a database table with several columns; most of them are VARCHAR(x) type
I have several dictionaries i populate from a database here is some sample of
I have an interesting problem here. I have a MySql database table that has
I have several table related to multilingual Photo Galley like AlbumCategories AlbumName Photos PhotoDetails
I have a table with several employees. They have the following columns empid,datecolumn1,is_valid. Very
Requirements : I have a table of several thousand questions. Users can view these
I have table A and table B with Table A having several columns including

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.