有三张表  A,B,C
A里面字段两个products_id(int)和products_model(varchar)
B和C表里面都有products_id这个字段和A表里面的products_id是关联的比如我现在知道了A表里面的products_model值   我想删除所知道的products_model字段的所有数据以及他的products_id但同时
B和C表里面相对应的products_id也进行删除。

解决方案 »

  1.   

    delete a.*,b.*,c.* from A a 
    inner join B b on b.products_id = a.products_id
    inner join C c on c.products_id = b.products_id
    where a.products_model = '值'
      

  2.   

    比如products_model这个值很多啦 该怎么改写啦刚才自己改写了 提示语法错误 。郁闷
      

  3.   

    我的意思products_model假如是200多个这种的语句实现起来比较麻烦 我刚才改了下 但提示语法错误
      

  4.   

    where a.products_model in ('值','值2','值3')....
      

  5.   

    delete zen_products.*,zen_products_discount_quantity.*,zen_products_notifications.* from zen_products a 
    inner join zen_products_discount_quantity b on b.products_id = a.products_id
    inner join zen_products_notifications c on c.products_id = b.products_id
    where a.products_model = '089566'报错:1109 - Unknown table 'zen_products' in MULTI DELETE
      

  6.   

    看来楼主的数据库水平已经到了无中生有的地步,这个要ACCESS的高级水平才能达到。一个a就像宝马一样就从天上掉下来了。