To dream of having a nightmare is an extremely rare phenomenon and suggests you are probably repressing a rather deep-seated emotional problem. If you know what it is, talk it over with someone you trust; otherwise, you may want to talk to a professional.