1. I failed the bar exam for which I studied day and night.

2. I failed the bar exam for what I studied day and night.

(Which one is correct?)

#1 is correct. #2 is not.