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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:07:29+00:00 2026-05-26T00:07:29+00:00

In SQL, while inserting into a presorted table, is it possible to insert a

  • 0

In SQL, while inserting into a presorted table, is it possible to insert a row while sorting the row along with the entire table? Such as

create table positional_order (
  num number,
  txt varchar2(10)
);

existing table

row 1   (3, 'three' );
row 2   (4, 'four' );

insert a new row

row 3   (1, 'one');

after the insert

table becomes

row 1   (1, 'one');
row 2   (3, 'three' );
row 3   (4, 'four' );

Is this possible?

Or I have to insert the row into the table and then do select order by ?

Btw I am using sqlite.

Thanks,

  • 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-26T00:07:30+00:00Added an answer on May 26, 2026 at 12:07 am

    Short answer: Tables are sets and do not have an order.

    Long answer: A clustered index is as close as it comes, and even that isn’t really all that close — w/o an order by, the query engine is free to return the results in any order it thinks best. A clustered index will mean that a query on just that table will most LIKELY return the rows in the order defined for the index, but don’t count on it. Now, that said, all indexes define A order and a clustered index defines an order of the records on disk, while this doesn’t guarantee your results in any particular order it does make it likely under most circumstances. But I would consider carefully before using a clustered index on anything but an auto generated/incremented column. If you insert into a table with a clustered index, records on disk may have to be relocated, and thats an expensive operation.

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

Sidebar

Related Questions

While trying to use LINQ to SQL I encountered several problems. I have table
I was trying to test the performance difference between inserting into a table directly
I have managed to insert the whole text-file data in SQL-SERVER database table with
I'm trying to insert some data from a XML document into a variable table.
I'm doing some work that involves inserting a batch of records into a Sql
Here is the code I am using to insert a record into the table...
I am having problems when inserting data into a sqlite table, I have read
I want to insert n records into a single table. There may be many
I'm tryin to insert dates using the date function while inserting posts. When the
Just wanted to know if there is a big chance to inject SQL While

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.