Ten months ago, when the candidate accosted his first New Yorker, with his favorite approach - "Hi, I'm Ed Koch, how am I doing?" - he was doing lousy.

Hundreds of thousands of queries on subway platforms, street-corners and beaches later. Rep. Edward Koch expects to be elected New York City's 105th mayor Tuesday and he doesn't need anyone to tell him how he's doing.

Koch has giant leads in every poll over his three remaining opponents. Liberal Mario Cuomo, Republican Roy Goodman and Conservative Barry Farber. The New York Daily News straw poll, which has never been wrong on a mayoral election it its 49 years, today gave Koch 53 per cent for Cuomo, and 4 per cent for both Goodman and Farber.

In his long run to the victory that appears to await him in 24 hours, Koch has left Mayor Abraham Beame, former Rep. Bella Abzug and most of the city's political power structure tasting the dust from his heels at one time or another.

Beame is a lame duck, Abzug is casting around for a new contest and is said to be considering running for Koch's congressional seat, and they both have endorsed Koch as have power structure representatives who have been swallowing the dust and joining Koch by the handful since he won the Sept. 8 primary over six rivals and Sept. 19 runoff over Cuomo.

Gov. Hugh Carey's rally to Koch's flag drew the most public attention, but labor and business leaders have been following suit.

Carey declined to support Koch early this year, believing he needed a better instrument with which to unseat his enemy Beame from City Hall. Carey pushed Cuomo into the race and only after the second primary round decided that since he hadn't beaten Koch he would join him.

Before the first primary, New York's well-known labor negotiator Theodore Kheel organized a meeting of labor and business leaders to stress the importance of keeping City Hall in the hands of a reasonable man. The group made clear that Koch, who had just pulled to a slight lead in polls, was the threat.

Barry Feinstein, president of Teamsters Local 237, and other labor leaders spoke of labor wars in New York if the wrong man won.

The Democratic Party nomination has usually been guaranteed victory in New York City, so they suspense went out of the race after Koch beat N.Y. Secretary of State Cuomo in the runoff primary.

After the victory, Koch moderated his anti-union campaign rhetoric and union leaders began to sign on. The president of the Uniformed Sanitationmen's Association, for example, waited until Oct. 31 and then announced his union's support for Koch.

"I don't pay much attention to what they say for election," John J. De Lury said in making that announcement.

Feinstein's union also fell in line last week. "The theory being we're very pragmatic and Koch is going to win. Also, we're a Democratic union," Feinstein said.

On the Republican side, former radio commentator Conservative Barry Farber tried for the Republican nomination but was beaten by regular Republican and Ex-Lax fortune heir Roy Goodman, a state senator.

A number of Republicans have deserted Goodman for either Cuomo, Koch or Farber in recent weeks, however, causing the GOP to fear its man will finish fourth. In Staten Island, one of the few Republican strong points in the city, the Daily News straw poll had Goodman running fourth with Cuomo winning. Koch will win all other boroughs, according to the poll.

After New York's years of financial crisis, which have seen large-scale business flight to other parts of the country, the mayoral race was touted by all candidates as the most important for many years. Despite the late support Koch has acquired from groups he initially criticized, he maintains he has made no deals and will enter City Hall in January without political debts that tie his hands.

Entering City Hall with Koch, if the polls are accurate, will be another candidate who started as a long-shot, Carol Bellamy. She won the Democratic nomination for the city's second most important job, president of the City Council, by defeating incumbent Paul O'Dwyer.