I have the following sql and I get 6 results. I only want to display the highest OpportunityStageID row (still need to see all 4 columns that coincide with the largest OpportunityStageID)
SELECT COH.CPEID
,os.OpportunityStageID
, OS.OpportunityStageName
, COH.CreateTS
FROM dbo.tblOpportunityStage AS OS LEFT OUTER JOIN
dbo.tblCPEOpportunityHistory AS COH ON OS.OpportunityStageID = COH.OpportunityStageID
where cOH.CPEID = 8437372
This is the output I get and I only want the largest row (in this case 6) I have tried MAX and clauses and I cant figure it out.
Photo of what i get ---> [1]: https://i.stack.imgur.com/NEc1S.png