Forum Moderators: coopster & phranque

Message Too Old, No Replies

need to delete matching ids accross two tables.

perl and mysql

         

warrior01

1:45 pm on Oct 8, 2004 (gmt 0)

10+ Year Member



hi there,

I have 3 tables:
stores
categories
store_categories

store_categories is a mapping table and has two fields (store_id and category_id).
store_id is the same as the ID field in stores. Now whenever I need to delete a store in stores, then I also need to delete the store_id in store_categories that matches the ID in stores.

But how? What's the right syntax for this?

Any help is greatly appreciated.

warumauchnicht

3:10 pm on Oct 10, 2004 (gmt 0)

10+ Year Member



I don't know if there is a mixed delete statement. But why don't you read out the wanted id and make a second statement?

[add]http://dev.mysql.com/doc/mysql/en/DELETE.html[/add]