Hi friends.
i have a PL/SQL fucntion that return some records about customers, and
the problem is :

I need help trying to optimize a query that is used for paging of an
aspx application.

The ideia of this query is return a set of records and this records
must by orderder by the customer name :

SELECT ID, DESCRIPTION
FROM (SELECT  a.*, ROWNUM RNUM
       FROM (SELECT   CUSTOMER_ID ID, FIRST_NAME DESCRIPTION
              FROM CUSTOMERS cust
             WHERE cust.TYPE='G'
             AND   cust.END_DATE IS NULL
             ORDER BY UPPER(FIRST_NAME)
            ) a
      WHERE ROWNUM <= 210 --<input parameter : if we want to get
customers between position 200 and 210(according to the alphabetical
ordering of customers), then we should put here the value  210>
     )
WHERE RNUM >= 200 210 --<input parameter : if we want to get customers
between position 200 and 210(according to the alphabetical ordering of
customers), then we should put here the value  200>


This query is very slow and need some improvements. Can you give me
idea ? Any trick ?


Regards,
Santana

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to