I have one table that has 12 conditions (months). I need to produce 12 outputs (tables) for select statements where the only thing that changes is that one condition (month).
Example:
SELECT * FROM table WHERE month = 01;
SELECT * FROM table WHERE month = 02;
SELECT * FROM table WHERE month = 03;
etc.
In reality, the code is pretty large and chunky, I don't feel like copy pasting it numerous times just to change one condition.
Is there a way to write one statement to produce different outputs based on changing condition?
It looks pretty basic to me, but I can't find the answer.