Hill Street Blues, set in an unnamed city, had a fairly codified rank system:
Captain = Frank Furillo. Under him:
Lieutenants Calletano (Furillo’s nominal second in command), Hunter (leader of the Emergency Action Team a.ka. SWAT) and Goldblum. These guys were largely administrative in function, although Hunter did go out with the EATs, and Calletano and Goldblum occasionally went on undercover assignments.
When Calletano was promoted to captain and sent off to another precinct, they brought in another lieutenant, Buntz. While he did occasionally administrative stuff (e.g. vetting new front-desk khaki officers) he went out into the field a lot more than the other LTs.
Sergeants = Esterhaus, the first turn-out sgt (“Let’s be careful out there!”) was the head of the squad room. When he died, Bates, recently promoted to the rank of sergeant, stepped in from motor patrol duty to take the position. She decided to go back to motor patrol, necessitating bringing in Sgt. Jablonski (“Let’s do it to them before they do it to us!”)
Mick Belker was a detective sergeant. He had no administrative duties, as far as we could see, and spent all his time undercover.
Detectives = LaRue, Washington; also Mayo, Garibaldi, possibly others. Plainclothes officers of various ranks. LaRue was probably senior as far as time on the force, but not in rank.
Patrolmen = Hill, Renko, Coffey, others.