• agreed.

    Create a flag column in temp table. Unique identifier for each if statement.