Q:

How can I get the value of non-aggregated column with an aggregated column? 

I have this sample table:
ColA   ColB   ColC
CBCP    25    popx
ABC1    10    ppp1
ABC1    25    ppxx
CBCP    30    xm2x

from there I would like to get these columns
ColA   ColB   ColC
ABC1    25    ppxx
CBCP    30    xm2x

what I would want is to get the row with max ColB.. But I am getting an error when I try to include the ColC in my query:
select ColA, max(ColB), ColC
from tblCaseDev
where ColB > getdate() group by ColA

this is my error..
Msg 8120, Level 16, State 1, Line 1
Column 'tblCaseDev. ColC' is invalid in the
select list because it is not contained in either
an aggregate function or the GROUP BY clause. 

hope someone could help me.. thanks in advance..

A:

SELECT
CaseNo,Date,Remarks,

(SELECT max(cast(Date as datetime)) FROM tblCaseDev subc WHERE subc. CaseNo=c.CaseNo Group by c.CaseNo) AS MaxEntryDate

FROM tblCaseDev c 

order by CaseNo

