Write a sql query to find n'th maximum in the database
table.

Answers were Sorted based on User's Feedback



Write a sql query to find n'th maximum in the database table...

Answer / sabarish

This is to find max value in a column.

select max(<column_name>) from <table_name> ;

Is This Answer Correct ?    17 Yes 6 No

Write a sql query to find n'th maximum in the database table...

Answer / srikar

This is to find nth max in the table.

select min(<column_name>) from <table_name> where
<column_name> in (select distinct top n * from <table_name>
order by <column_name> desc)

Is This Answer Correct ?    9 Yes 5 No

Write a sql query to find n'th maximum in the database table...

Answer / laxman

show tables;
this is wrkg in myql
it will show all the tables in row wise so u can easly find out

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Programming Code AllOther Interview Questions

In LSMW , what does the following error mean and how to rectify it : Incorrect interface data for set 78 in method C . This error is occuring in idoc processing step of LSMW.

0 Answers   Wipro,


I have multiple datasets and I have to search a particular string in all of them at a single time. Please suggest a full jcl or rexx tool for it.

0 Answers  


What is the coding about how to recognize color in fuzzy logic using Matlab R2009b?

0 Answers  


JasperETL how to install and create simple project explain me clearly fnds iam wtg for ur rply

0 Answers  


Write a Program to find the reverse of a given number.

0 Answers   InterGraph,






How can we write an algorithm for show max and min from two integer inputs ? without using if() , without any functions ...

1 Answers  


Write a program to Print the Pascal triangle

0 Answers   InterGraph,


Could u please tell me any UNIX scripts that 'll lead to find the network latency of the servers.?or else any unix command to find the network latency of a server?Thnx in advance...

0 Answers   Cap Gemini,


Hi, I want the code to fetch multiple rows in REXX using RLX and CURSOR. Can anyone help me?

0 Answers  


i want run following code on button click of view. i am trying to retrieve data from isc_order_details table and isc_product table. but after retriaval of data i m getting error like FIELD MUST BE ENTERED!! DECLARE m number; n number; CURSOR order_details IS SELECT PRODUCT_ORDER_QUAN,PRODUCT_ID FROM isc_order_details WHERE order_id=:isc_order_master.order_id; amount NUMBER (8,2):=0.0; alert number; BEGIN go_block('isc_order_details'); first_record; m:=:system.cursor_record; last_record; n:=:system.cursor_record; OPEN order_details; --for i in m..n loop FETCH order_details INTO :ISC_ORDER_DETAILS.PRODUCT_ORDER_QUAN,:ISC_ORDER_DETAIL S.PRODUCT_ID; IF order_details%FOUND THEN SELECT order_value,order_date INTO :ISC_ORDER_MASTER.ORDER_VALUE,:ISC_ORDER_MASTER.ORDER_D ATE FROM isc_order_master WHERE order_id=:ISC_ORDER_MASTER.ORDER_ID; SELECT product_desc,product_price INTO :ISC_ORDER_DETAILS.PRODUCT_DESC,:ISC_ORDER_DETAILS.PROD UCT_PRICE FROM isc_product WHERE product_id=:ISC_ORDER_DETAILS.PRODUCT_ID; next_record; END IF; EXIT WHEN order_details%NOTFOUND; END LOOP; last_record; CLOSE order_details; EXCEPTION when NO_DATA_FOUND then alert:=SHOW_ALERT('ENTER_DATA'); Go_Item('isc_order_master.order_id'); END;

0 Answers   Zensar,


find out the list of users who have access to all t-codes starts with 'SU'? thanks in advance all.

0 Answers  


How many digit have a Polaris 1995 300c.c. 2x4 nad how many have a Polaris 2007 300 c.c 2x4? And what site I can check this information???

0 Answers   FlashTECH,


Categories