Deleteing from multiple tables

    Date: 06/28/05 (MySQL Communtiy)    Keywords: mysql, sql

    I have 6 tables, all with a column called "projid" in them. I need to create a delete statement that will delete all rows in all columns where the projid is a specified number. I've read the MYSQL docs on this topic, but I'm still mightily confused. What I think I need is something like this:

    DELETE FROM projecttable, collabtable, miletable, stafftable, benetable, invtable
    WHERE projid=32


    However, I'm fairly certain that the WHERE statement isn't right, and I'm not sure if I need to put the table names after the delete as well as after the FROM, or only one place, or what. Can anyone either explain the syntax I need or point me to a tutorial or something that will help?

    Source: http://www.livejournal.com/community/mysql/60657.html

« Database quandry.. || Moving data from version... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home