Query for duplicate patients

For users or potential users.
Post Reply
User avatar
savvy
Posts: 438
Joined: Wed Sep 12, 2007 9:25 pm
Location: Berkeley, California

Query for duplicate patients

Post by savvy » Mon May 11, 2015 9:34 pm

I would like a query that finds duplicate patient names.
Thanks!
Cheers!!
Candy is dandy, but sex won't rot your teeth.

Cheers!!!
Go Bears!!!!!
Savvy

User avatar
jsalmon
Posts: 1553
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Query for duplicate patients

Post by jsalmon » Tue May 12, 2015 8:58 am

Query #65 considers first and last names:

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;
http://opendentalsoft.com:1942/ODQueryL ... yList.aspx
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

Post Reply