Doug,

Try using EXISTS and two subqueries. The basic idea is 
 
SELECT  match.IdNumber
FROM    YourTable AS match
WHERE   NOT EXISTS 
        (
            --- subquery to find children of (match.IdNumber)
        )
        OR EXISTS 
        (
            --- subquery to find parent of (match.IdNumber)
        )

Janet

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2758
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6

Reply via email to