I have data in two columns. I need to write a query that only shows the customers that have gone over their credit limit and by how much:
customer balance credit limit
418.75 500
10.75 200
200.1 100
Of course this doesn’t take customer information into account since you didn’t mention any customer tables, but this should get you the customer balance and overage:
It’s pretty straight-forward; you select customers with a balance over their limit, and just select the difference as a third column.