8i Predecessor Query-Applying a LIMIT in 8.0.5

(ok, this may not be the correct forum for this question...but having search around the dicussions, there doesn't appear to be another more appropriate)
This is a common question that has arisen some 90+ times in the discussion groups overall...namely if one wishes to SELECT from a table, subject to some WHERE conditions and the ORDER by some related date/age, how does one limit the size of the resultset passed back. For example, one may wish to recover say the latest 10 or 20 results. For 8.1.5/8.1.6 onwards an encapsulated sub-query would work, for example:
SELECT * FROM
SELECT Article.*
FROM Article,AssetPub
WHERE AssetPub.label = 'xxxxx'
AND Article.id = 'yyyyy'
ORDER BY Article.age
WHERE RowNum < [some number, eg 10 or 20]
Does anyone have any bright ideas as to what might be a suitable equivalent for use with Oracle V8.0.5, in order to achieve the same functionality ?
null

If it was only on the Article table, you could create an index on the age fiels and use this in a hint. This gives you the rows in the 'indexed' order. I never tried it but I have read it in a tuning course.
SELECT * FROM
SELECT /*+ INDEX(age_index)
Article.*
FROM Article
WHERE Article.id = 'yyyyy'
WHERE RowNum < [some number, eg 10 or 20]
null

Similar Messages

  • OID-Query Entry Return Limit not functioning for OIM

    Hi,
    I have connected Thor Xellerate (Oracle Identity Manager is the new name) to OID 9i and reconciled users from OID. The Query Entry Return Limit set on OID by default is 1000 and I have 1100 hundred users in OID.
    I am able to get all users (means all 1100 users are reconciled) without any problem. I would like to know the significance of this Query Entry Return Limit in this context and whether my understanding is correct or not. Can anybody help me in this regard?
    Thanks & Regards,
    Krishna

    Krishna,
    it's interesting that despite the fact that the OID entry return size limit is set to 1000 the reconcile can retrieve 1100 entries. The default behaviour should be that you should see an error msg stating "size limit exceeded". Anyway set the size limit in OID to a higher value just to be on the save side.
    regards,
    --Olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Lync 2013 Clients, video applied bandwidth limit source

    We have a single Lync 2013 Std server and single Lync 2013 Std edge server.
    Clients are Lync 2013 with latest Office updates.
    Clients connected via 1Gbps switch ports to each other and the Lync server, all on the same subnet.
    Video calls between clients are having a low bandwidth limit applied to them, usually
    Applied bandwidth limit: 350 Kbps
    Applied bandwidth source: PreferenceValue
    This of course limits the video quality, often to 480x240 15FPS.
    Clients are Core i7, 2 cores (4 threads), support H264 acceleration (Intel HD Video 4000) and have WinRSAT Video Encode Score of 7.4
    CSMediaConfiguration has MaxVideoRateAllowed set to Hd720p15M, CSConferencingPolicy has VideoRateKb set to 50000
    What is the "preference value" and where is it coming from?

    Hi,
    AppliedBandwidthLimit - This is the actual bandwidth applied to the given send side stream given various policy settings (TURN, API, SDP, Policy Server, and so on). This is not to be confused with the effective bandwidth because there can be a lower effective
    bandwidth based on the bandwidth estimate. This is basically the maximum bandwidth the send stream can take barring limits imposed by the bandwidth estimate.
    More details:
    https://technet.microsoft.com/en-us/library/jj721928.aspx
    Best Regards,
    Eason Huang
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Eason Huang
    TechNet Community Support

  • ABAP Query - Want to limit the number of records to 5

    I have a query based on a a table join (MKPF with MSEG) infoset. I want to limit the number of records to first five.
    How to deal with it?

    select data from tables using join and where conditions....into internal table....
    now move the first 5 records to second internal table and use them...
    or else in ur select statement u can use...
    select  data from tables <join condition> upto 5 rows.
    Message was edited by:
            Ramesh Babu Chirumamilla

  • Query for credit limit of customers of a particular type

    Hi,
    We are using SAP B1 2007B PL04 and want to activate credit limit so that whenever a delivery or A/R breaches the credit limit then the document must go for approval. However we want this to be activated only when the customers are having group code say 110 and not for others.
    So basically could you all help me with a query which would do the following
    1. check whether customer for whom delivery or A/R is being generated belongs to group having croup code 110
    2. check if the credit limit set in BP master  for that customer will be breached if the delivery or A/R is made (ie Current A/R or delivery amount when added to current outstanding will exceed the credit limit)
    3. if yes then will activate approval procedure and send the document for approval as per approval template
    Thanks
    regards
    Pradipta

    hi Gordon
    Thanks for the reply
    could you please tell me what does this $[$29.0.number]
    signify and
    secondly can i add WHERE T1.CreditLine - T1.Balance < $[$29.0.number]
    and T1.[GroupCode]=122
    as i want this query to only run when the customer belong to a particular group
    Also please tell me how do i test this query from query manager
    Thanks
    Regards
    Pradipta

  • Query Builder Table Limit

    What is the limit on the number of tables that Query Builder can display? I am new to BI Publisher and when I connect to my datasource and select my schema I get the message "The list of tables is too long." There are about 80 tables in the selected schema.
    We will have some developers working on our project who are not familiar with this applications schemas and would like to know what the limit is so we can understand how big a problem it will be for us and whether we should use something other than Query Builder to write our queries.
    Thanks.

    Hi
    I get the same message.I connected to the Apps database and the connection was successful.
    I would retrieve tables from schema which has 60 tables in it.For others even when I enter the first few letters in the serach entry field they cannot be retrived.
    I installed the BI Publisher 10.1.3.3.2 for Windows x86 (703 MB) on my local machine and I'm using http://wal1cd231.cis.concentra.corp:9704/xmlpserver/
    to login into BI publisher enterprise using the administrator credentials provided when installed.
    Any solution???

  • Query for Credit Limit Approval Procedure

    Hi experts,
    Need your help with an approval procedure query. There is already the option to launch when the BP's balance exceeds the credit limit by a set dollar amount. What we would like is for the procedure to launch when the balance exceeds an additional 10% of their credit limit.
    Ex: Customer's credit limit = $1,000. We want the approval procedure to kick in when the sales document causes their balance to be >= $1,100. Thanks.

    Adding this to the WHERE clause will include the DocTotal
    T0.Balance + $[$29.0.Number]
    SELECT distinct 'true' FROM OCRD T0 WHERE T0.CardCode = $[OINV.CardCode] AND
    (T0.Balance + $[$29.0.Number]) >= T0.[CreditLine] * 1.1

  • RFC used to query customer credit limit and current usage

    Hi,
    I have been asked to provide information about a customers credit limit and usage. I can see this information is in table KNKK but I cant find any suitable RFC (needs to be remotely enabled) to access this data.
    Does anyone know where I can access this data?
    Cheers, Paul

    Have you checked fm
    CREDITCONTROL_READ_KNKK
    Its normal fm may be you can write wrapper above this and make it as RFC

  • Query applied in forms

    hi
    im not sure on how to show my query on the forms that i am using. i am new to oracle form builder 9i. My query is as stated below
    CREATE OR REPLACE VIEW OZ AS
    select DISTINCT court_id
    from booking
    where court_id not IN
    (select court_id
    from booking
    where lower (booking_start_time) = lower('&booking_start_time')
    and lower (booking_date) = lower('&booking_date')
    and lower (court_id) = lower('&court_id')
    and lower (booking_status) = lower('&booking_status'));
    Im not sure how i would be able to type in the availability fields in the forms that need entering in the fields mentioned in the script above. How would this be done
    thanks for reading.

    Hi,
    i think one chance is to use a stored procedure as Block DataSource.
    Create a Package:
    create or replace court_disp as
    TYPE t_courtrec IS RECORD(
    court_id booking.court_id%TYPE
    TYPE t_courttab IS TABLE OF t_courtrec
    INDEX BY BINARY_INTEGER;
    PROCEDURE court_qry(
    pt_block_data IN OUT t_courttab
    , p_start_time IN varchar2
    , p_end_time IN varchar2
    , p_court_id IN varchar2
    , p_status IN varchar2
    in procedure court_qry:
    ln_lfd := 1;
    for cr in ( select distinct court_id from ... )
    loop
    pt_block_data( ln_lfd ).court_id := cr.court_id;
    ln_lfd := ln_lfd + 1;
    end loop;
    U can use datablock wizard to assign parameters.
    good luck
    Robert

  • Applying LIMIT (dimen.) TO TOP (...) BASEDON (...) structure in OLAP_TABLE

    Hi
    I'd like to know how to apply structure
    LIMIT dimension TO TOP (number of top member performers) BASEDON (measure)
    in OLAP_TABLE.
    For instance I have a cube SALES with 2 measures: SALES_VALUE and QUANTITY and a dimension PRODUCT with two levels: TOTAL and PRODUCT_NAME. Then I want to list 3 products with the highest SALES_VALUE and QUANTITY > 100.
    I can create for example such query:
    SELECT sales_val, quant, product_dsc
    FROM TABLE(OLAP_TABLE(
    'test_schema.test_aw DURATION SESSION',
    null,
    null,
    MEASURE sales_val FROM sales_value
    MEASURE quant FROM quantity
    DIMENSION product WITH
    HIERARCHY product_parentrel
    INHIERARCHY product_inhier
    ATTRIBUTE product_dsc FROM product_description
    ROW2CELL r2c'))
    WHERE
    OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1
    AND OLAP_EXPRESSION_BOOL(R2C, ' quantity gt 100')=1
    AND OLAP_CONDITION(R2C, 'LIMIT product TO TOP 3 BASEDON sales_value, 1)=1;  ???????
    Instruction above does not work completely well, because it will give 3 rows with top values of SALES_VALUE measure, but in this case OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1 is not fulfilled (row with values of TOTAL_PRODUCT level appears).
    One can create such query:
    SELECT sales_val, quant, product_dsc
    FROM TABLE(OLAP_TABLE(
    'test_schema.test_aw DURATION SESSION',
    null,
    *'LIMIT product TO TOP 3 BASEDON sales_value', ?????*
    MEASURE sales_val FROM sales_value
    MEASURE quant FROM quantity
    DIMENSION product WITH
    HIERARCHY product_parentrel
    INHIERARCHY product_inhier
    ATTRIBUTE product_dsc FROM product_description
    ROW2CELL r2c'))
    where
    OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1
    AND OLAP_EXPRESSION_BOOL(R2C, ' quantity gt 100')=1;
    It leads to the same result as the first query.
    What shuold I do to make OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)
    fulfill in query above?
    I can add that query below works as it should (LIMIT TO TOP... omitted).
    SELECT sales_val, quant, product_dsc
    FROM TABLE(OLAP_TABLE(
    'test_schema.test_aw DURATION SESSION',
    null,
    null,
    MEASURE sales_val FROM sales_value
    MEASURE quant FROM quantity
    DIMENSION product WITH
    HIERARCHY product_parentrel
    INHIERARCHY product_inhier
    ATTRIBUTE product_dsc FROM product_description
    ROW2CELL r2c'))
    WHERE
    OLAP_CONDITION(R2C, 'LIMIT product TO product_levelrel eq ''PRODUCT_NAME''', 1)=1
    AND OLAP_EXPRESSION_BOOL(R2C, ' quantity gt 100')=1;
    Thank you in advance for any help
    Peter

    Peter, Yes, I hadn't considered the condition sales_value greater than 100 in my mail.
    You can try either of the below limit cmds to include that condition too:
    limit product to limit(limit(limit(product to (product_levelrel eq 'PRODUCT_NAME') AND (sales_value gt 100)) keep top 3 basedon sales_value) sort top 3 basedon sales_value)
    -or-
    limit product to limit(limit(limit(limit(product to product_levelrel eq 'PRODUCT_NAME') keep sales_value gt 100) keep top 3 basedon sales_value) sort top 3 basedon sales_value)
    I dont think one can be sure that having separate olap_condition filters for each condition will work fine all the time. To simulate the cascading of AND operations of where clause (filters) in SQL, we can use the nested limit() function to act on progressively smaller/better qualified resultsets (cells). SQL query would apply the AND filters in any manner or order that the optimizer deems fit whereas using the limit function with keyword "keep" within it indicates an implicit order of filters. SQL query with multiple olap_conditions might rank and find top 3 -or- bottom 5 before it applies the filter "sales_value gt 100". In such a case, you may find that the query will return no rows or return only the top 1 or 2 out of top 3 which are gt 100 -or- in case of bottom, return no rows or return less than 5 members (only those above 100) -- not necessarily 3 "top 3" or 5 "bottom 5" members.
    rgds
    Shankar

  • Make Content Query Web Part Resolve list of Resolvable Items before Trimming Item Limit

    I have a problem whereby My Content Query WebPart does not show me the list of items to which I have a permission.
    I am able to see the items from my document library but cannot see them 
    I have identified the problem as being the Item Limit just by removing this setting.
    It seems that the Content Query applies the Item limit settings before trying to resolving the permissions.
    E.g. Say I have 100 items in my document library and do not have permissions on the first 50 items.
     If I set Item limit to 10 in my CQWP, It select the first 10 items of my document library and then resolve permissions on the 10 selected items. This will result in zero items shown in my CQWP as I do not have permission
    to see the first 10 items in the library.
    I would like to be able to tell the CQWP to first resolve the permissions and return the set of items in the document library for which I have permission (in the e.g. the last 50 items), and then select the 10 first items
    and show them in the CQWP.
    How can this be done?
    Thanks and Regards,
    Rhyan.

    I'm not sure you'd be able to make changes to that aspect of the CQWP but the Content By Search Web Part should trim before hand, it's also the 'flavour of the month' for SP2013. Would that be a viable choice?

  • IR Apply Filter for OLAP Query (Essbase)

    Guys, this is what i am struggling with.
    1. First Question - Finding the true level of the filter someone just applied:
    - Someone selects product ABC from the filter prompt box in IR against Essbase. Product ABC is built like Products-->Total Products-->Brand A-->ABC. Now, through script, how do i know product ABC is below all the levels i just listed above?
    2. Second - I cannot apply a limit THROUGH SCRIPT simply on "Products.ABC". The IR script errors out. The IR script only works if i have the following syntax "ActiveDocument.Sections["OLAPQuery1"].Filters.Add("Products.Total Products.Brand A.ABC");
    Any IR / OLAP / Essbase experts out there that can help?
    One question ... should i simply find ABC, look for a parent for ABC and keep going up the chain and document the structure and use that?

    Hi, Shantanu,
    This does what you requested:
    SELECT    *
    FROM       table_x
    WHERE       incidence     = 'N'
    OR       (    status               != 1     -- Cancelled
           AND  (   status           != 2     -- Closed
                OR  completion_date     IS NOT NULL
           AND  activity_status          != 'Cancelled'
    ;Among other things, this assumes that status and activity_status are never NULL. If they can be NULL, the solution is a little messier, but only a little: instead of things like
    status   != 1you have to say
    NVL (status, 0)   != 1 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Applied Transactions window for A/R invoices as a query

    When I right-click on an A/R invoice and open the Applied Transactions window, I see all transactions that hit that invoice.
    I need to create a query that displays the contents of that window, but only for a given date. Has anyone written something like this?
    TIA.

    Hello,
    I have a similar requirement. Currently I am querying several tables to get a result like 'applied transactions'..
    OINV and INV1 for position details and linking to credit memos.
    ORCT and RCT2 for incoming payments.
    ORIN for credit memos.
    This is really complicated and one serious problem occurs: I don't get incoming payments with 'payment on account', since they have no entry in RCT2.
    I have tried to get payments on account with OITR and ITR1, but the specific reconciliation does only show the DocNum of the incoming payment (payment on account), not any link to the reconciled invoice.
    Do I miss something or is there a smoother way to query applied transactions?
    Thanks in advance
    Sebastian

  • Improve performance of  an inline view query

    All,
    I have a unique situation where I have to limit the number of rows based on group. so I created an Inline view and applied a limit on it.
    ex:
    SELECT col_A, col_B FROM ( SELECT col_a, count(*) FROM tab_a WHERE col_a = 'XXX' GROUP BY col_a) ROWNUM <-10.
    but this design was rejected, because it seems to have a great impact on performance due to inline view.
    Also I cant set a rowlimit directly on the query because GROUP BY clause is used in the select.
    When the rownum is directly applied in the WHERE, first it limits the rows and then it makes a GROUP, so when user asks to retrieve 10 records, it may show less than 10 rows because of the grouping.
    please help to find a alternative solution which helps to get the expected result set and same time without loosing performance.

    Hi,
    The sql you gave us is not valid. There is no "col_b" in your inline view, there is no "where" before "rownum<10", and the inline view returns only one row.
    Try to produce a reproducible scenario with scott.emp and scott.dept generated by $ORACLE_HOME/rdbms/admin/utlsampl.sql
    Regards
    Laurent

  • Oracle SQL Connector for HDFS - Where is the filter applied?

    I have just managed to get the Oracle SQL Connector for HDFS (YEAH!)
    working on a Linux 2VM cluster and was curious where the filter in the where clause is being applied to limit the data.
    i.e. is it being pushed clear down into hadoop or is hadoop pulling all the data and then then it's being filtered or does all the data get buffered into the database or what?
    Thanks
    Mark

    Along the same lines of this question, does anybody know a way to connect from Oracle to Hadoop/HDFS in such a way as to push the query filter down into the Hadoop query?
    I really don't want to pull ALL my hdfs data into the Oracle buffer cache for processing!
    Thanks
    Mark

Maybe you are looking for

  • Ricoh (NRG) printer wont be installed

    Our Nashuatec 424 prints nice from OS X after help from Greg Sahlii and when installed PPDs from linuxprinting and Ghostscript and foomatic-RIP. But one powerbok is not printing. I have done reinstall of both Ghostscript, foomatic and put the PPD in

  • Need to decide to keep data in DSO or not

    Hi all, Could someone please help me with the following scenario. We have some data that is being loaded to DSO from there into 2 cubes. One cube will hold very detailed data (just like in DSO, which was created for faster reporting), Another Cube ho

  • Using Mac Book in China

    I just got my blac Mac Book and am going to China in a couple of weeks. Do I just need a plug adapter or do I also need an eletrical converter for this trip?? Thanks. Mac Book   Mac OS X (10.4.6)  

  • Delta in ODS

    Hi, Could someone please explain the delta process in ODS. Thanks. Regards, Jon.

  • (OBIEE11G install) - FAIL at step 13, impossible to start OPMN

    Hi I'm trying to install OBIEE 11G, but I've encountered some problems. I can connect to the Oracle Weblogic admin console. I can connect to the Oracle Fusion Middleware Control (entreprise manager). But, in the list of servers, I've got only the "Ad