>Hi all, I need to retrieve the largest value from one of my tables in SS, my code is shown below
>
>
>Select ClaimRef,max(Claim.AdmittedValUSD) as admval from claim
>group by ClaimRef
>
>
>
>I expected to get 1 record but receive thousands ? any idea why ?
>ClaimRef is unique PK
You get thousands records because ClaimRef is unique.
If you want to get MAX(Claim.AdmittedValUSD) over ALL records you must use:
Select MAX(AdmittedValUSD) as admval
from claim
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.