How often this question is asked, and the answer of course is 'what do you want to take pics of'.
If you are looking to enter your images in major competitions and possibly exhibit them, then maximum resolution is essential especially if large prints are needed several feet in size.
So what are we talking about? DSLR of course. I know very well that many compacts offer amazing resolution, but sometimes more is required perhaps in the sensors employed to capture the image. The very best sensors I believe are to be found in expensive cameras, probably full frame. But then again, before the advent of full frame in digital sensors appeared, many professionals did very well with dx sensors. If all you need a camera for is to take with you on holiday, or just snap the kids or the pets, then many compacts will suffice. DO be careful though and choose one that you can understand easily and can use the menu ok. My wife bought a compact recently and just cannot understand the menu and how to use it. This camera offers 12 mp in resolution, but she is now saying that she wants to sell it because it is so complicated. So the lesson is---- when looking at you chosen camera in the shop, try to use the menu and use all its applications, understanding them before you part with your money. It would be embarrasing at a later date to have to sell it because you can't get to grips with it. Modern cameras can require the user to have a degree in technology, so be aware.