NULLs cannot be compared directly (with "="). You can handle NULLs using the coalesce statement like this:
DELETE FROM public.TableName as T1
USING public.TableName as T2
WHERE T1.ctid > T2.ctid
AND COALESCE(T1."Guide",'') = COALESCE(T2."Guide",'')
AND COALESCE(T1."FileSource",'') = COALESCE(T2."FileSource",'')
AND COALESCE(T1."CodeName",'') = COALESCE(T2."CodeName",'');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…