I have a MySQL table similar to:
Sometimes agents take a deposit to go towards their commission, and they take may also more then they are entitled to for a particular sale, so the commission field can contain a positive or negative value.
I need to do a report GROUPed BY location AND agent, but only include those groups (and list all sales details: date, qty, comment,) where the total commission for that group is > 0. How can I do that? Would I need a sub-query here?
Any help would be greatly appreciated.