To listen to jury selection in the trial of Marion Barry, Washington's bad hat mayor, is to take a tour through the complexities of trying him.

There's no effort in Judge Thomas Penfield Jackson's courtroom to find someone who doesn't know about the mayor's transgressions, the most scandalous of which is recorded on videotape. Ignorance was the standard in the trial of Oliver L. North, and after much dredging 12 people and two alternates were found who had shut the Iran-contra affair out of their lives. But Barry cannot be avoided. He has been everywhere trying to make the trial an anti-climax.

He has moved about the city as if it were some giant courtroom, and the entire citizenry his jury. He goes on television and radio, scattering alibis, stalking that "one juror who will not convict Marion Barry," baiting a local television station to play the famous videotape it is said to possess, so it will be old news in the courtroom.

He has problems, sure. His record as mayor is no better than his character. He may be no worse than some Capitol Hill cutups, but none is his equal in shamelessness. He's not a role model, he admitted, but "that's not a crime."

District residents find it hard to be objective about their mayor. For one thing, so many of them work for him. One in every three families has a member on the District's swollen payroll. The Capital City has three times the employees of any other city of comparable size, and the bureaucrats' world is small. One prospective juror works in the Department of Public Works, and her boss, she forgot to mention in the questionnaire the judge had distributed, is a witness for the prosecution.

The mayor likes to remind the people who work for him of where their allegiance should be. A couple of weeks ago, he hosted a $17,000 Riverfest cruise for city employees.

The questioning by the prosecutors, Richard Roberts and Judith Retchin, also revealed how troublesome the entrapment issue can be. There was universal loathing for "sting" operations, dubious acknowledgment that they are sometimes necessary.

Roberts asked repeatedly how the prospective jurors felt about undercover operations. One woman, whose number was 20 in the 250-member panel, said she thought they would be justified in the case of "a dangerous person who has committed a heinous crime."

She was, however, rock-solid on truth-telling, and obviously would employ the strictest standards on the perjury charges against the mayor.

"You tell the truth even if it kills you," she declared. "That's what my grandma always told me."

An older woman, a retired crossing guard who is a volunteer for Special Olympics, was death on drugs -- "because people who take them do weird things . . . strange things harmful to themselves . . . {and} other people" -- but thinks the mayor "is a good man." The hidden microphone and camera didn't bother her, but "it is not okay to tell a lie -- you should tell the truth at all times."

The mayor looked on cheerfully. He is improbably aglow. His new-found sobriety has removed the puffiness and erased the deep lines on his face. He has, of course, found God. When he entered the court, he joked with artists in the front row and waved to fans in back. At times he leaned so far back in his chair that he was almost horizontal. He has a skilled lawyer in the elegantly dressed, sharply focused R. Kenneth Mundy.

But most cheering of all he is hearing the ambivalence about himself and his case that he has so sedulously cultivated. And he is hearing talk of race, which he has said through all his troubles is the root cause of his fall.

A preppy young white man, obviously uncomfortable in the witness stand, spoke vaguely of his "concerns" about being a juror. When pressed, he would say only that he realized "the sensitivity of the trial," which was interpreted by those hearing him as another way of saying how tricky it would be for a white man to pass judgment on the black mayor of a predominantly black city.

A slight young black man whose face was almost lost in the collar of his shirt gave raw voice to the hidden theme. A cab driver and former Marine who had undergone treatment for alcoholism, he was asked by the prosecutor if he thought the mayor's race had anything to do with his being in court. "Yes, I think so," he replied.

"Discrimination happens," he said, "it happened to me" -- and told of being passed over for a Marine Corps promotion in favor of a white man.

"Do you believe race has played a role in this case?" he was asked.

"Yes, I believe race has played a role in this case. It is a factor in everything -- not just in this case, but a factor in anything."