我用来删除一些记录,
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
任何人都可以告诉我如何构建我的查询正确
任何建议都将不胜感激
答案 0 :(得分:0)
如果您有多个表(联接),则需要指定要删除的表。
DELETE T1
FROM T1
INNER JOIN T2 ON T1.key = T2.key
WHERE condition