I have a query to get duplicate data with some extra condition but I feel that it is not fast enough. Any solution to make this query faster?
v_listing
contains big information
SELECT DISTINCT code, name, comm, address, area
FROM v_listing t1
WHERE EXISTS (SELECT NULL
FROM v_listing t2
WHERE t1.comm = t2.comm
AND t1.address = t2.address
AND t1.area = t2.area
AND (t1.code > t2.code OR t1.code < t2.code))
ORDER BY comm, address, area