scubakiz wrote:
Yes, it's the same problem. The first query is incomplete and won't
run on most servers since you need a GRUP BY clause with agragate
functions like MAX. The second query is in the correct form, but is
asking the wrong question.
In addition to the suggested solutions. Here are two more:
Select S.sname, s.age from Sailors S
where not exists (
select 1 from Sailors R where R.age S.age
)
select sname, age from (
select sname, age, rownumber() over (order by age) as rn
from Sailors
) X where rn = 1
Also note that select TP 1 is a vendorspecific feature, and might not
work with your DBMS
HTH
Lennart