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
Does server sql treat char as a variable-length or fixed-length column?
How to fetch the next row from a cursor with a "fetch" statement?
Why olap is used?
How do I open a .db file?
How to disable stored procedure sql server?
What is the data type of time?
How many databases can we create in a single server?
What is mean by candidate key?
Can you name a few encryption mechanisms in sql server?
Why truncate is ddl?
Explain what are commit and rollback in sql?
List types of tables in SQL Azure?
How do I shrink an ldf file?
What are difference between Cluster index and Non-Cluster index?
What stored by the model?