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 |
Can you access the DB2 Directory table using SQL?
How to get Top 10 Salaries from a Table
when i am trying to update a table having 1000 rows. the program abends.how we will come to know the last successful updated row was. we are not using any commit operations
I am having n number of records in a table which consists of emp-name is one of the field among them. Now i want to change the first letter of every name with capital.
in my table i will update only 100 record among 1000 records i need to display recently updated record'.....can u tell me where those records are stored how can i display those records...?if there is any sql query pls let me know....?
OUTER JOINS USED TO GET MATCHING AND NONMATCHING ROWS FORM 2 OR MORE TABLES BASED ON COLUMNS. SIMPLE JOINS ALSO DO THE SAME THEN WHAT IS THE USE OF OUTER JOINS.
How is deadlock resolved?
How would the varchar column remarks defined?
What is package in cobol db2?
can we view the access paths created by dbrm ? how ? thx
What type of database is db2?
the dd name for ksds is dest1 and what is the dd name for alternate index of ksds ? a.dest b.dest1 c.dest1a d.dd1