Delete multiple records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to delete say 4000 records, out of total 5000 records. I want to
keep 1000 records based on the field BOREHOLE.

Table LOCATION has a field called BOREHOLE which is a Primary key to that
table LOCATION. Table LOCATION is related to one-to-many relationship with
other table.

I have to DELETE all records except BOREHOLE

A-3
A-4
AS-1
AS-9
BHP-13
BHP-14
C-10
.....
......
C-4

upto 1000 BOREHOLE

I could not figure-out how to accomplish this tak.How can I write the SQL
DELETE query, so that only 1000 records remain based on the query?

Thank you for your help.

Pranesh
 
Pranesh said:
Hi,

I'm trying to delete say 4000 records, out of total 5000 records. I
want to keep 1000 records based on the field BOREHOLE.

Table LOCATION has a field called BOREHOLE which is a Primary key to
that table LOCATION. Table LOCATION is related to one-to-many
relationship with other table.

I have to DELETE all records except BOREHOLE

A-3
A-4
AS-1
AS-9
BHP-13
BHP-14
C-10
....
.....
C-4

upto 1000 BOREHOLE

I could not figure-out how to accomplish this tak.How can I write the
SQL DELETE query, so that only 1000 records remain based on the query?

Thank you for your help.

Pranesh

It's not clear to me what you're asking. Are you saying that you want
to delete all except the 1000 records that have the lowest values of
BOREHOLE? Are you meaning to delete these records from the table
LOCATION, which has BOREHOLE as its primary key, or from the other,
related table you mentioned?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top