Hey...I am in a bind here. I am not much of a programmer but the guy who does the sql at my business is out sick.
If I have a table like this (I am simplifying this a lot but this is where I am stuck).
Name Object Payment
Joe A 100
Jan A 200
Joe A 300
Ron A 500
Jan A 100
Joe B 200
How do I write a query that would give me:
Joe A 300
Jan A 200
Ron A 500
Joe B 200
Essentially the highest value in the Payment field for each name. Thanks. Sorry if I sound dumb...but I just cant find anything on the internet to help me.
select Name, Object, max(Payment) as MaxPayment
from MyTable
group by Name, Object
select Name, Object, max(Payment)
from table
group by Name, Object
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With