I have student marks in a student table. I need second
highest mark .Then what will the query for this?

Answer Posted / devi

Get data to internal table from database table using select query.
Sort the second internal table by ascending order.
Then use Delete adjacent duplicates comparing highest marks.
It will remove duplicate highest marks.
Then sort the internal table by descending order.
Read internal table into workarea index 2.
It will give the second highest mark.

Some times we have to process more steps using all data's. At that time we have to create two internal table with same structure . Move the data from firs table to second table and do the above steps.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default server name for sql server?

803


tell me the disaster recovery plan

2188


What are cursors stored procedures and triggers?

676


How will you add a dimension to cube? : sql server analysis services, ssas

746


What are the five characteristics of good data?

679






How to restore performance issues and how to check?

1708


What are the types of resultset?

708


how to define testing of network layers? : Sql server database administration

655


As per your opinion what are the five top responsibilities of a dba? : sql server database administration

827


Where cross join is used?

688


What are the types of database schema? : sql server analysis services, ssas

781


What is the benefit of normalization?

786


What is sql server management studio? : sql server management studio

736


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

2032


What is etl - extraction, transformation, and loading?

667