find max value per groupAbhinav Abhishek12yAsked Oct 1, 2014, 1:55 PM1.1kfirst find max part rate from 0001 branch, if not found in 0001 branch then find max rate in all the other branches.Table Result
Pradeep Shet12y agoPosted Oct 1, 2014, 5:09 PMHi,Find the below query SELECT Id, Branch, Part, RateFROM tblWHERE Branch IN (SELECT Branch FROM tbl GROUP BY Branch HAVING MAX(Rate) > 0)Chk if this works for you. If yes plz mark it as answeredThank you
Pradeep ShetPosted Oct 1, 2014, 5:09 PM
Find the below query
SELECT Id, Branch, Part, Rate
FROM tbl
WHERE Branch IN (SELECT Branch
FROM tbl
GROUP BY Branch
HAVING MAX(Rate) > 0)
Chk if this works for you. If yes plz mark it as answered
Thank you