sql query to get all members in a category