Not at all.
Might feel good for that split second where somebody else shows you that they want you, but once you're naked and lying with them, feels awful, and then afterwards... it feels even worse.
People need to let themselves get over people naturally, have fun, go out, realise you can still do pretty much all of the stuff you used to do with your ex - with friends instead, just start enjoying yourself again without that person.
That's how I get over people, not by shagging someone else.

...saying that though, I do however think it's not a bad idea to go out and flirt, meet members of the opposite sex and so on.
It helps you to remember you're still attractive and still wanted and desired by other people. Which is what you need when you've just broken up with someone, to remember that you can get someone else and it's not the end of the world.

In my case, I've tried it. And, yeah, when it's happening, sex DOES help you get over your problems.

But afterwards, the old problems are still there. What's worse, you also have to deal with any new problems you've introduced by sleeping with that person.

In my case, I've never been able to do one-night-stands; any time I sleep with someone, I always develop feelings for him/her. I'm starting to learn that, for me, if the other person isn't interested in forming some kind of relationship, it's probably a good idea not to sleep with him/her.