The situation is , I have a table which has for example 10 rows.
I want to calculate the value of ‘price’ column and want to select the complete row ehich has MAX price.
var offer = (from p in dc.CustomerOffer
join q in dc.OffersInBranch
on p.ID equals q.OfferID
where q.BranchID == singleLoc.ID
select (p.OriginalPrice - p.NewPrice) * 100 / p.OriginalPrice).Max();
The above code gives me only the MAX price, How would I select the whole row.
Any ideas guys??
Try the following code :
Note : This is a dummy code and it might not be syntactically correct. You might have to tweak the query as per your requirement.