0
Good morning, I need some guidance regarding the following situation:
In this table I need to return only the MAX(nutab) for each codprod and control. I tried using the MAX, but so only returned what is equal to 80 that would be the max(nutab)... the problem is that I have more products in this table and for example the MAX(nutab) of the product 210 is 80, but the product 211 is already 76, this way I can not return all data only with MAX(nutab).
So even for sure, the problem is that I need to return the vlrvenda field in the query too... with this grouping no longer right
– Matheus
Good for this just add the vlrvenda between the selected columns. I will update the answer to see if it is what you are looking for.
– Luan Michel