📜  sql 截断表引用自身 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:23.141000             🧑  作者: Mango

代码示例1
-- Original:
UPDATE 'recursive' SET 'parent_id' = NULL WHERE 'parent_id' IS NOT NULL;
DELETE FROM 'recursive';

-- For Example:
UPDATE Items
    SET Items.ParentItemId = NULL 
    WHERE Items.ParentItemId IS NOT NULL;
DELETE FROM Items;
-- Or 
TRUNCATE TABLE Items;