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 an execution plan? How would you view the execution plan?
How many levels of sp nesting is possible?
How to insert and update data into a table with "insert" and "update" statements?
Explain different types of self contained sub query?
Explain the concept of recursive stored procedure.
List out different types of normalizations in sql server and explain each of them?
What are the types of user defined functions in sql server?
What is the stuff and how does it differ from the replace function?
In what version of sql server were synonyms released?
What are the parts of a function?
Explain nested stored procedure. Syntax and an example for create nested stored procedure?
Explain what is raid and what are different types of raid levels?
How will you decide the active and passive nodes?
How do you handle datasets larger than 50 gb?
What is create command?