加入时删除时语法错误

时间:2015-10-16 15:44:03

标签: mysql

我用来删除一些记录,

public override void Input0_ProcessInputRow(Input0Buffer Row)
{
    // Create an array of the department numbers as strings
    string[] Edpt = Row.DeptNo.Split(new char[] { ',' });

    // no longer needed
    int i = 0;

    // foreach avoids off by one errors
    foreach (var item in Edpt)
    {

        Output0Buffer.AddRow();

        Output0Buffer.ID = Row.ID;
        Output0Buffer.Name = Row.Name;
        Output0Buffer.Location = Row.Location;

        // use the iterator directly
        Output0Buffer.DeptNo = Int32.Parse(item);
    }

}

但它返回在delete FROM product_to_category c inner JOIN product_description d ON c.product_id = d.product_id WHERE c.category_id IN (3, 6) GROUP BY c.product_id HAVING COUNT(DISTINCT c.category_id) = 2 ORDER BY d.name asc

附近使用的语法错误

任何人都可以告诉我如何构建我的查询正确

任何建议都将不胜感激

1 个答案:

答案 0 :(得分:0)

如果您有多个表(联接),则需要指定要删除的表。

DELETE T1
FROM T1
INNER JOIN T2 ON T1.key = T2.key
WHERE condition