Select specific records

  • Thread starter Thread starter Vina
  • Start date Start date
V

Vina

Can someone help me or give me an idea on how to handle
this:

I have a table and all i need is to select every 4th
record.

ex: All i need is item 1 and item 8

item 1
item 2
item 3
item 4
item 5
item 6
item 7
item 8

any help is appreciated.

thanks
Vina
 
There is no "inherent" order in a table. So, what field is the table to be
ordered by?

HTH,
TC
 
AND, what is the "primary key" of the table?

(If you don't know what is a primary key, you need to do some research on
that. Every table in a properly designed relational database, should have a
primary key.)

HTH,
TC
 
I have a counter(autonumber) for primary key. There is
really no specific sort or order i need, i just want a
random result, i just want to take the every 4th record
to be pulled and placed on a different table.

Thanks
 
So you really want to pick 25% of the records, at random. Correct?

If so, try this (untested):

SELECT TOP 25 PERCENT *
INTO MyNewTable
FROM MyOldTable;

HTH,
TC
 
Back
Top