Loops should be avoided, they are not fast.

Please attach some dummy data & what you want to find