List members by membership

I need code to list members based on their membership. Is this possible?