Sorting w/Primary Key

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I have sorted column 10 then column 11. I then want to
add a primary key after it is sorted. When I do, it
screws up the sort that I did. Is there any way to keep
this from happening?

Scotty
 
In a database, Sorting does not physically change the order of the records
stored. There IS no intrinsic order to records in a table. Sorting only
DISPLAYS them in a given order. So the Primary Key has nothing whatsoever
to do with Sorting. It is used for uniqueness and linking records to other
tables in a Join. That's it.
 
I have sorted column 10 then column 11. I then want to
add a primary key after it is sorted. When I do, it
screws up the sort that I did. Is there any way to keep
this from happening?

Scotty

Roger's right (and my previous post was right if you're the same
person).

If you want sorted data, use a Query. End of story. Tables ARE NOT
SORTED.
 
Okay, so how would I use a query to sort column N and
column M, without changing the order of the ID field that
is the primary key, and extract only items based on
a "between # and #" criteria? I guess that is the
question I am trying to ask. Sorry. I am a little new
at this...
 
Okay, so how would I use a query to sort column N and
column M, without changing the order of the ID field that
is the primary key, and extract only items based on
a "between # and #" criteria? I guess that is the
question I am trying to ask. Sorry. I am a little new
at this...

It is not necessary to *sort* records in order to *select* records.
They are quite different and independent operations.

Create a Query based on your table. Put on the Criteria line

BETWEEN 1 AND 50000

on the field that you want to use as the key for extraction.

Put Ascending on the Sort row for N and for M.

You'll then get 50000 (or fewer, if there are gaps) records with the
specified range of values on the first field; those 50000 records will
be sorted in order of ascending N, and within each value of N, by
ascending M.
 
Back
Top