I have a table which has different types of balance and I need to deduct the balance from different columns based on availability.
Here is the query (Sample) I tried to use but it didn't work
when column_A>table_B.balance then column_A
when column_B>table_B.balance then column_B
when column_C>table_B.balance then column_C