Reputation: 57
I am looking to find all names (PName
) in a table that have ages(PAge
) greater than the age of the person who has the PID
of 3.
So far I have:
SELECT PName
FROM Person
WHERE PAge >= [PAge].[PID].[3]
Upvotes: 0
Views: 48
Reputation: 2814
You cant reference a second row in that way, at least not in standard sql.
Use
SELECT PName FROM Person WHERE PAge >= (select PAge from Person where PID=3)
Upvotes: 3