Untested:

Select * from table where cParent in (select cPerson from table where
cPerson = cParent and nBalance < 100)

Tracy

-----Original Message-----
From: KAM.covad
Sent: Monday, July 20, 2009 9:44 AM

I have a table with 3 fields and about 20,000 records. 

The fields are cPerson C(9), cParent C(9), nBalance N(10,2). The cPerson
field has a candidate index (unique). If this is a parent record, the
cPerson is the same as cParent, otherwise it is a child record. 

To get all the parents with balance less than $100, I can:
Select * from table where cPerson = cParent and nBalance < 100

Now I need all the children of those parents in the same cursor




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/001c01ca0941$97f10600$c7d312...@com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to