The company decided to arrange an exchange of experience between employees. To do this, every day one of the employees makes a report. Employees appear in alphabetical order. After all the staff members made a report, the first employee becomes a speaker. Create a query that returns the name of the speaker, if you know the name of the previous speaker.
Actually let the table Emp consist only of the field ename - the name of the employee. It is not so important. I thought that you can glue it twice and bring it together with the rownum.
SELECT ename, rownum FROM( SELECT ename, rownum FROM(SELECT ename FROM Emp ORDER BY ename) UNION ALL SELECT ename, rownum FROM (SELECT ename FROM Emp ORDER BY ename) ); Then it seems to me logical to ask the user for a name, find the first occurrence of this name in the table, take its rownum, increase by 1 and select the desired name from the table. But how to add it to this query, I'm already confused.