Does this return the results that you're looking for?
SELECT t1.*
FROM Ppgval t1
WHERE gvald IN (SELECT max(gvald) FROM Ppgval t2
WHERE t1.node = t2.node And t1.rollno = t2.rollno)
-Mike
>Sergey:
>
>Oops! Time I put my head in a bucket of ice water! I wrote 'row' when I meant 'column' (Maybe that Preview button is for thinking about what you have written <g>)
>
>Using your most recent suggestion I sent the query
>
>SELECT t1.* FROM Ppgval t1
> WHERE EXISTS ( SELECT * FROM Ppgval t2
> WHERE t1.node = t2.node And t1.rollno = t2.rollno
> AND t1.gvald = MAX(t2.gvald))
>
>to SQL and got back the response:
>
>Server: Msg 147, Level 16, State 1, Line 1
>An aggregate may not appear in the WHERE clause unless it is in a subquery
>contained in a HAVING clause or a select list, and the column being
>aggregated is an outer reference.
>
>
>It seems to me that both these options only work with a GROUP BY clause.
>
>- g -