Querry problem...

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

Guest

I'm trying to run the following query string

DELETE
FROM InfoUSA1 INNER JOIN TPSPA ON (InfoUSA1.areacode=TPSPA.areacode) AND (InfoUSA1.phone=TPSPA.phone)

Where I am trying to delete matching records from the InfoUSA1 table

I keep getting an error message saying thatI need to Specify the Table I want to delete records from, what am I doing wrong

Thanks!
 
Fred G said:
I'm trying to run the following query string:

DELETE *
FROM InfoUSA1 INNER JOIN TPSPA ON (InfoUSA1.areacode=TPSPA.areacode)
AND (InfoUSA1.phone=TPSPA.phone);

Where I am trying to delete matching records from the InfoUSA1 table.

I keep getting an error message saying thatI need to Specify the
Table I want to delete records from, what am I doing wrong?

Thanks!

Since there are two tables involved in the query, you have to specify
which one you want to delete from. Assuming that you want to delete
from InforUSA1, you would write:

DELETE InfoUSA1.*
FROM InfoUSA1 INNER JOIN TPSPA
ON (InfoUSA1.areacode=TPSPA.areacode)
AND (InfoUSA1.phone=TPSPA.phone);

Depending on the indexes of the tables involved, though, you may get the
error message "Could not delete from specified tables", or something
like that. I think there must be a unique index in TPSPA on the
combination of fields {areacode, phone}, for this to work.
 
Back
Top