I have four tables :
- Batch(batch_id, batch_start_date, batch_strength, course_id)
- Course(course_id, course_name, course_category, course_fees, course_duration)
- Enrollment(batch_id, student_id, enrollment_date)
- Student(student_id, student_name, student_mail, student_date_of_birth, student_city, student_phone, student_qualification)
Now according to the question I have to display the coursename which has 2nd highest revenue collection
According to the above question here is my solution
select c.course_name, c.course_fees*count(c.course_name) Total_Revenue
from course c join(batch b join enrollment e
on b.batch_id=e.batch_id)
on c.course_id=b.course_id
group by c.course_name, c.course_fees
order by Total_Revenue desc ;
Now the problem is I am not able to extract the second row from the resulting table from the above code. How can I extract second row from the above resulting table?(Answer specific to Oracle 11g is appreciated)