Before asking for help please read "How to request help" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

How to Find Duplicate Records by Father's and Son's Names 6 days 2 hours ago #1

  • xmlf
  • xmlf's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 174
I want to search the entire database for duplicate individual records.
Although there is a "Duplicate records" function in the control panel, it is done by querying the wt_date table and it is not possible to find all duplicate records.
I want to SQL both the father's name and the son's name (it would be nice to include the grandfather's name as well) and their xrefs, which is most likely a duplicate record when there are two identical records (both with the same father and son's name).
How do I write this Sql statement? Thank you.
Wang Family Website of Suining County, China
https://www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.

Please Log in or Create an account to join the conversation.

Last edit: by xmlf.

How to Find Duplicate Records by Father's and Son's Names 6 days 1 hour ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13693
Individuals are linked via families.

You can query the connections using the table wt_link

wt_individual -> wt_link (FAMC) -> wt_link (FAMS) -> wt_individual
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

How to Find Duplicate Records by Father's and Son's Names 6 days 1 hour ago #3

  • xmlf
  • xmlf's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 174
The result of the query is to get their names and show both the father's and son's names.
Is it necessary to use the wt_name table?
Wang Family Website of Suining County, China
https://www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.

Please Log in or Create an account to join the conversation.

How to Find Duplicate Records by Father's and Son's Names 6 days 1 hour ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13693
> Is it necessary to use the wt_name table?

Yes.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

How to Find Duplicate Records by Father's and Son's Names 6 days 1 hour ago #5

  • xmlf
  • xmlf's Avatar Topic Author
  • Offline
  • Junior
  • Junior
  • Posts: 174
So how do I display both the father's and son's names?
A select statement does not seem easy to implement.
Wang Family Website of Suining County, China
https://www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.

Please Log in or Create an account to join the conversation.

How to Find Duplicate Records by Father's and Son's Names 6 days 1 hour ago #6

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13693
In #2, I showed how to link parent and child.

You will need this twice. (child, individual, parent). e.g.

wt_individual -> wt_link (FAMC) -> wt_link (FAMS) -> wt_individual -> wt_link (FAMC) -> wt_link (FAMS) -> wt_individual

Each wt_individual will need to link to wt_name.

You will then need to group results to find duplicates.

> A select statement does not seem easy to implement.

Agreed.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum