-- Assume we have a table called Employees with columns Id, Name, and Salary
-- Assume there is only one employee with the name Ram
-- Use a subquery to get Ram's salary
SELECT Id, Name, Salary
FROM Employees
WHERE Salary > (SELECT Salary FROM Employees WHERE Name = 'Ram')
Tags
sql