There are many pro and cons of inquiring about the salaries of coworkers while working in a team because salaries are the touchiest subject for the employees when they are working under the rood of same company and for the same position.
People get frustrated:
Everyone can have different salaries from each other and it can hurt someone that can also disturb the relation between them. People get frustrated when they came to know that there coworker is paid more than them, they begin jealousy from them.
People get motivation:
On the contrary, people who are always pleasant and don’t hate others, they inquire from people about their positions, goals and salaries and set their own goals for future to earn more than them. They learn from those at higher positions and utilize those teachings in their duties to become better. They take guidelines as how to negotiate their salaries when applying for another opportunity.
Don’t ask people when you are not comfortable with them, at the first day of you job and don’t inquire repeatedly because people find it very annoying that gives a bad impression.