i have table agdet i want first 5 maximum commission which
query will you write for this thanks in advance
Answers were Sorted based on User's Feedback
Answer / yuvaevergreen
exec sql
select commission from agdet order by commission desc
fetch first 5 rows only
end-exec;
Is This Answer Correct ? | 10 Yes | 0 No |
Answer / girish
select * from agdet a where 5 >= (select commission from
agdet a , agdet b where b.commission > = a. commission)with
ur;
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / thiru
select * from agdet order by commission fetch first 5 rows
only for read only with ur
Is This Answer Correct ? | 3 Yes | 7 No |
What is a collection?
What is difference between alias and synonym in db2?
Can DB2 be accessed by TSO users? If yes, which command is used to invoke DB2?
can you use symbolic parameters in JOB?
How do you do the EXPLAIN of a dynamic SQL statement?
How do I add a column to an existing table in db2?
Can you access the DB2 Directory table using SQL?
Why use RUNSTAT Utility?
How is the value function used?
What should be specified along with a cursor in order to continue updating process after commit?
Can any one tell me about Restart logic in DB2.
What are the three lock types?