If you want to get results based on the output of another query, then sub queries will be used.You can use sub queries in the SELECT, FROM, WHERE.... clausesEx:SELECT EMPLOYEE_ID, SALARY, FIRST_NAME || ' ' || LAST_NAME "Highest Paid Employee"FROM EMPLOYEESWHERE SALARY = (SELECT MAX (SALARY) FROM EMPLOYEES) -- this is the sub query for getting highest salary of employees