Nearly half of New York City voters believe that Mayor Bill de Blasio doesn’t deserve a second term — but he’d win because they’d vote for him anyway, according to a poll released Wednesday by Quinnipiac University.

Hypothetical prospective candidates would fail to defeat de Blasio, according to Quinnipiac, which surveyed 1,138 voters, including 738 Democrats.

“They give him tepid job approval ratings, but you know the line — you’ve heard it million times — you can’t beat somebody with nobody,” said pollster Maurice Carroll.

So far, de Blasio is the only prominent Democrat to announce a mayoral run in 2017. Clinching the party’s nomination is often tantamount to winning the general election, because registered Democrats outnumber Republicans 6 to 1 in the city.

In a hypothetical matchup, de Blasio would win 34 percent of the vote; 15 percent for former City Council Speaker Christine Quinn, 9 percent for City Comptroller Scott Stringer; 7 percent for Bronx Borough President Rubén Díaz Jr.; and 6 percent for Brooklyn Borough President Eric Adams.

According to the poll, 49 percent of voters say de Blasio doesn’t deserve re-election, compared to 39 percent who think otherwise.

De Blasio’s job approval rating is up — an equal number of voters, 47 percent, approve as disapprove. That’s up from 51 percent who said they disapproved and 42 percent approved, when surveyed for an August 1 poll.

Carroll said he could not explain the ostensibly contradictory results from the three categories.

De Blasio did not answer media questions yesterday on any subject but Donald Trump, but in a written statement about the poll, his campaign adviser Phil Walzak said: “The mayor is fighting every day to make our city stronger and fairer for every community, and we are happy to compare his record against anyone.”

The same racial divide of every poll since de Blasio took office persists in the latest one. Black voters approve of de Blasio 71 percent to 22 percent, while white voters disapprove 67 percent to 28 percent.

“Blacks love him. Whites don’t much like him,” Carroll said. “In a Democratic primary, that means he wins.”

The poll, of cellphones and landlines called Nov. 9 to Nov. 15, is limited by a margin of sampling error of plus or minus 2.9 percentage points. The sampling error for Democratic-only questions is 3.6 percentage points.