Wordpress Archives Page

I need a page to show all the posts in a selected month, and on the sidebar it has to show a list like this:
OCTOBER 2006
NOVEMBER 2006
Only showing the months that there is actually a post or more on. When you click on one, it has to show all the posts from that month. The thing is, I don’t know how to check the months that have posts in… anybody can help please?