Yes its right but if there are more than 1,00,000 records in the respective table and if we want the output in a specific order, so here we might have to include an ORDER BY clause. Now if we use only one FETCH FIRST Clause and also a Order By clause all the records in the table will be proccessed and will sorted in specific order and out of these ordered records only FIRST 10 records will be selected. So here the processing time will be increased. Is there any way to process only 10 records and order only that 10 records as given below
(SELECT XXXXXX FORM XXXXX
FETCH FIRST 10 ROWS ONLY)
UNION
(SELECT XXXXXX FORM XXXXX
FETCH FIRST 10 ROWS ONLY)
ORDER BY 1 DESC
WITH UR;
(Is there any subsitute way to achive above query as the above query is giving me an error)
Thanks for your reply.
Nouman Memon
Patni Computer's