Hi, I have two simple tables T1 and T2 as follows:
T1 T2
sid results sid name
1 90 1 John
2 100 2 Mary
3 80 3 Peter
4 92 4 Jim
I want to select the name of the student who has the highest score, and I wrote:
SELECT name
FROM T2
WHERE sid =
(
SELECT sid
FROM T1
WHERE results =
(
SELECT MAX(results)
FROM T1
)
)
is there any more efficient way of doing this? Thanks!