Duplicate Clients (SQL)
v7,v6
Finds duplicate clients.
Use Merging Duplicate Client and Animal Records article to merge any records.
Checking for same last name and mobile number that have status active by default.
You can change contact type = 6 to match by lastname and email.
See Create Export to CSV using SQL Query for information on using query below for export to csv.
Checking for same last name and mobile number that have status active by default.
You can change contact type = 6 to match by lastname and email.
See Create Export to CSV using SQL Query for information on using query below for export to csv.
select
C1."Last_Name",
"Trim"("FirstCode"(P1."Details",80)),
C1."Status"
from "Client_Main" C1 Join "Contacts" P1
on P1."Person_Type" = 'C' and
P1."Number" = C1."Ref_Number"
where C1."Ref_Number" > 10000001000
and C1."Status" = 'A'
and P1."Contact_Type" = 5
Group By
C1."Last_Name",
"Trim"("FirstCode"(P1."Details",80)),
C1."Status"
having Count(C1."Ref_Number") > 1