Thanks Janet, Tested your example but returns all parent and child ids. Needs to filter out parents where first two digits of ID numbers match. If there is more than one ID with same first two digits, the ID in the series ending with '00' needs to be omitted.
I have been playing with substring() to filter but nothing that works yet. +-----------------------------+ | 3100 | parent with children | | 3101 | child one | 3102 | child two | 3200 | parent without child +-----------------------------+ should return +-----------------------------+ | 3101 | child one | 3102 | child two | 3200 | parent without child +-----------------------------+ Doug ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2759 Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
