I would like a query that finds duplicate patient names.
Thanks!
Cheers!!
Query for duplicate patients
Query for duplicate patients
Candy is dandy, but sex won't rot your teeth.
Cheers!!!
Go Bears!!!!!
Savvy
Cheers!!!
Go Bears!!!!!
Savvy
Re: Query for duplicate patients
Query #65 considers first and last names:
http://opendentalsoft.com:1942/ODQueryL ... yList.aspx
Code: Select all
/*65*/
/*WARNING: On versions before 14.3.1 that are using replication, do not run this query from multiple computers at the same time or replication will crash.*/
DROP TABLE IF EXISTS tmp;
CREATE TABLE tmp
SELECT COUNT(*) AS count, LName, FName FROM patient WHERE patstatus<>4 GROUP BY LName, FName HAVING count>1;
SELECT p.* FROM tmp, patient p
WHERE tmp.LName=p.LName AND tmp.FName=p.FName AND patstatus<>4
ORDER BY LName,FName;
DROP TABLE IF EXISTS tmp;
The best thing about a boolean is even if you are wrong, you are only off by a bit.
Jason Salmon
Open Dental Software
http://www.opendental.com
Jason Salmon
Open Dental Software
http://www.opendental.com