Dynamic SQL, thought it would be easy but either it’s hard or I’m dumb : SQL