Do you have the suggestion to optimise this sql syntax to check the duplication data?
(CASE WHEN ((SELECT COUNT (*)
FROM {Table A}
INNER JOIN ...
WHERE ...
) >= 2) THEN (True) ELSE (False) END)
One optimisation I could think of is ’exists’ instead of count.
SELECT CASE
WHEN EXISTS (SELECT 1
FROM {Table A} A
GROUP BY {columns to determine duplication}
HAVING COUNT(*) > 1)
THEN True
ELSE False
END AS HasDuplicate