>Id1 Id2
>1 2
>1 3
>2 3
>
>Does that make more sense?
Yes, now I have understood what you need.
I don't thing it's possible with a single select, can you scan/endscan the table?
scan
"select-sql for the conditions"
"insert into a cursor the selected id"
endscan
Franco