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
What is the default server name for sql server?
tell me the disaster recovery plan
What are cursors stored procedures and triggers?
How will you add a dimension to cube? : sql server analysis services, ssas
What are the five characteristics of good data?
How to restore performance issues and how to check?
What are the types of resultset?
how to define testing of network layers? : Sql server database administration
As per your opinion what are the five top responsibilities of a dba? : sql server database administration
Where cross join is used?
What are the types of database schema? : sql server analysis services, ssas
What is the benefit of normalization?
What is sql server management studio? : sql server management studio
What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?
What is etl - extraction, transformation, and loading?