[AccessD] Check for duplicate children in table

David McAfee dmcafee at pacbell.net
Tue Dec 6 15:12:57 CST 2005


Something like this will show you all sourcenames where the targetPID exists
more than once.

SELECT B.TargetPID , B.sourceNAME
FROM
(SELECT Count(TargetPID ) AS CountOfID, TargetPID
FROM Allocations
GROUP BY TargetPID
HAVING (((Count(TargetPID ))>1))
) AS A
 INNER JOIN Allocations AS B
ON A.TargetPID = B.TargetPID ;



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Kaup, Chester
Sent: Tuesday, December 06, 2005 12:19 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Check for duplicate children in table


All data is on one table named Allocations. What I need to know is if
exactly the same children exist within more than one parent. This is
kind of new territory for me so hopefully I can explain it. Thanks.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee
Sent: Tuesday, December 06, 2005 2:12 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Check for duplicate children in table

It my help to give us some table names and table structure layout.

Is this is a self joined table? Do you want to know where a parentID is
listed more than once?

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Kaup, Chester
Sent: Tuesday, December 06, 2005 11:31 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Check for duplicate children in table


I need to see if an parents in a field named TargetPID in a table have
the same children in a field named sourceNAME. Any parent can have 1 to
10 children. I need some help on how to check if any parents have the
same children as another parent. No I did not pick the field names.
Thanks.



Chester Kaup

Engineering Technician

Kinder Morgan CO2 Company, LLP

Office (432) 688-3797

FAX (432) 688-3799





No trees were killed in the sending of this message. However a large
number of electrons were terribly inconvenienced.



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list