• Hi Patrick,

    I'm not sure you'd need to use a loop. Would a cross join not work?

    select sid, pid, mid

    from testA, TestC