USE child ORDER cdxTag IN 0 USE parent ORDER cdxTag IN 0 USE grandparent IN 0 SELECT child BROWSE LAST NOWAIT SELECT parent SET RELATION TO iKeyId INTO child BROWSE LAST NOWAIT SELECT grandparent SET RELATION TO iKeyId INTO parent BROWSE LAST NOWAITMove your windows around, and you can visualize your grandparent / parent / child relationship easily.
SELECT grandparent SCAN FOR NOT EOF('parent') SCATTER NAME lo SELECT parent SCATTER NAME lo ADDITIVE SCAN FOR NOT EOF('child') * Here, you have grandparent, parent, and child aligned. SCATTER NAME lo ADDITIVE * Right now, lo contains all fields from all tables, and will iterate as it should * Pass lo as a memory object, copy as necessary, etc. ENDSCAN ENDSCANAnother way is to use SET SKIP TO. With that feature, you can just use SKIP in a loop, and it will auto-skip through the relationships, skipping through each child, then each parent, then each grandparent, exhausting each one before proceeding up the chain. It gives you a type of SQL-SELECT like view of the data, but with the individual tables in tact.