Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELETE query

Status
Not open for further replies.

peasepud

Programmer
Jul 20, 2007
35
0
0
Hi,

Im trying to delete records from two tables but am hitting a #1064 error but Im totally lost as to whats wrong!

DELETE FROM tbl_topics, tbl_posts WHERE tbl_topics.posts = 0 AND tbl_topics.tid = tbl_posts.topic_id


So basically Im joining table 1 and table 2 on one field but only removing those that have a zero in the posts field of table 1.

Any ideas would be greatly appreciated.

 
have a look at the DELETE statement in the manual, it gives several examples, and this is one of them

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top