If you're thinking of handing in your resignation from your current job, here's a statistic you should consider first: 23 percent of people who quit a job wind up wishing they hadn't. That's the surprising result of a new survey of 1,000 professionals by Accountemps, a staffing and service company for accounting and bookkeeping.

That still leaves you a three-out-of-four chance of being happy if you do quit your job. But it's worth taking a look at why people are sorry about quitting, and making sure you avoid repeating their mistakes. Here are their biggest regrets.

1. "I left good friends and colleagues."

At 28 percent, this is the number-one reason why people who left jobs are sorry they did. And it's true that a great group of co-workers can make all the difference between a fun job and an awful one.

Is friendship with your co-workers a good enough reason to stick with a job that isn't right for you? That can be a tough call. It depends on how the job fits into your career plans and how you feel about that career, as well as how you feel about your co-workers.

If you love the people at your workplace but can't stand your job, consider a few other options. Perhaps after you leave you can keep up social contact with your former colleagues. For example, if they have lunch or drinks in the same place every week, you might join them at those times. Or, if you land at a company you really like, you may be able to entice some of your former colleagues to come join you.

2. "I left for the wrong reasons."

Almost as many respondents--27 percent--said this was why they regretted leaving their former jobs. So before you walk into your boss's office and announce that you're leaving, take a good long look at why you want to go. If there are aspects of your job that you can't bear, perhaps some of those tasks could be lessened, or delegated. If you don't like working for your boss, perhaps a lateral move to another part of the company would solve the problem.

Consider that you might encounter many of the problems you have at this job at your next job, and that addressing those dissatisfactions where you are might ultimately be a better idea than moving on. At least explore the possibilities before you resign.

3. "I left a great boss or mentor."

Few things are as wonderful as working for a boss or having a mentor whom you truly admire, respect, and can learn from, so it's no surprise that 20 percent regretted leaving their former jobs for this reason. A great mentor relationship isn't something you should walk away from lightly. And yet the time will come when you do have to walk away. At some point, even the greatest mentors will have taught you all they have to teach. The same goes for even the greatest bosses. Besides, your mentor or your boss may also move on to a different job or a different company, so even if you plan to stick around forever, he or she may not.

When is the right time to move on from a great boss or mentor? You'll know it when the time is right. But don't assume that just because you aren't working together anymore, your boss or mentor will be gone from your life. Make the effort to stay in touch, and to meet up for coffee or lunch from time to time. You may find that your former mentor can still offer great advice and help you succeed at your new job, just as at your old one.

4. "I didn't explore other opportunities at the company."

Only 12 percent of those who regret leaving a job said this was the reason, but that's still 12 percent too many. If you don't like your job but do like your workplace, you should be looking for other options already. You should have an eye out for them all the time.

Ask for a meeting with your mentor or boss and inquire what career opportunities he or she sees for you, either right away or in the future. If there's another department or team where you think you might like to work, reach out to that team's manager and ask about opportunities there. Or sit down with HR and find out what other jobs throughout your company might be a good fit for you.

Whatever you do, don't wait. Another job offer could come your way unexpectedly and you might have to make a quick decision. You'll want to know what your options are before that happens.

5. "I didn't ask for a promotion."

If a promotion, a change in responsibilities, or a raise would turn your bad job into a good one, then it's downright silly not to ask for one or all of those. Especially since 4 percent of those who regret leaving a job are now sorry that they didn't.

Think hard about the timing of your request. If you've just completed a successful project, it's probably a good time. If something you were working on didn't pan out, you should probably wait till things are going better. You obviously don't want to ask for a raise when budgets are tight. On the other hand, it might be a great time to ask for extra responsibility if you're willing to take it on without immediately getting a salary bump.

The important lesson here is that you probably won't get what you want unless you ask for it. And that will be just as true at a new job as it is in your current one.