Need to find out the hierarchy information of a particular Menu

I have written a query using "select ... start with initial-condition connect by recurse-condition" syntax to get the Hierarchical information for a prticular menu.
select count(SUB_MENU_ID) from FND_MENU_ENTRIES_VL
start with MENU_ID = 76580
and SUB_MENU_ID is not null
connect by prior menu_id=sub_menu_id
O/P: *16*
Now if I write the query to get the number of record manually upto level 2 thats gives me the output as *36*.
select distinct(SUB_MENU_ID) from FND_MENU_ENTRIES_VL
where MENU_ID = 76580
and SUB_MENU_ID is not null
union
select distinct(SUB_MENU_ID) from FND_MENU_ENTRIES_VL where MENU_ID in(
select distinct(SUB_MENU_ID) from FND_MENU_ENTRIES_VL where MENU_ID = 76580
and SUB_MENU_ID is not null)
Please let know whats wrong with the first query.

Hi,
Whenever you have a question, please post CREATE TABLE and INSERT statements for your sample data, so that the people who want to help you can re-create the problem and test their ideas. From looking at your posting:
981094 wrote:
SUB_MENU_ID     MENU_ID
67723     72570
67723     72581
77139
     76580It's impossible to know even which columns are NULL.
Read the forum FAQ {message:id=9360002} again, especially the part about sample data (section 7) and the part on \ tags (section 9).
If you want to restrict a CONNECT BY query to LEVEL<x, then just include that condition in the CONNECT BY clause:SELECT COUNT (sub_menu_id)
FROM      fnd_menu_entries_vl
START WITH     menu_id          = 76580
AND     sub_menu_id     IS NOT NULL
CONNECT BY      PRIOR menu_id     = sub_menu_id
     AND     LEVEL           <= 2
You could also put that condition in a WHERE clause, to discard the rows after they were found.  But it's more efficient to put conditions like that in the CONNECT BY clause, so the unwanted rows are not found in the first place.
Your CONNECT BY query does not consider whether the sub_menu_ids found were distinct or not.  If you're trying to find an alternative query that does not use CONNECT BY, why are you including DISTINCT when that wasn't part of the original query?
In the UNION query you posted, the first branch (before the keyword UNION) corresponds to LEVEL=1 of the CONNECT BY query, but the second branch (after the keyword UNION) corresponds to what would be LEVEL=2 if the CONNECT BY condition was
"menu_id = PRIOR sub_menu_id", but for your CONNECT BY condition:
"PRIOR menu_id = sub_menu_id", a corresponding UNION query would be:SELECT sub_menu_id
FROM      fnd_menu_entries_vl
WHERE     menu_id      = 76580
AND     sub_menu_id     IS NOT NULL
UNION ALL
SELECT sub_menu_id
FROM     fnd_menu_entries_vl
WHERE     sub_menu_id IN (
          SELECT menu_id     -- DISTINCT not needed in an IN sub-query
               FROM fnd_menu_entries_vl
               WHERE menu_id     = 76580
               AND sub_menu_id     IS NOT NULL
Depending on what results you want, you may or may not need SELECT *DISTINCT* outside of the IN-subquery, but you never need DISTINCT in the IN-subquery.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • 10 laksh records and need to find out the top5 salary

    Hi,
    I have emp table with 10 laksh records and need to find out the top5 salary.I formed the below mentioned query,
    SELECT ROWNUM,SAL,EMPNO,ENAME,DEPTNO FROM(SELECT ENAME,EMPNO,
    DEPTNO,SAL FROM EMP ORDER BY SAL DESC) WHERE ROWNUM<=3 AND SAL IS NOT NULL;
    i would like tune this query or anyother new qeury find out top5 salary.
    By
    Siva

    kn_sivaraman wrote:
    Hi,
    I have emp table with 10 laksh records and need to find out the top5 salary.I formed the below mentioned query,
    SELECT ROWNUM,SAL,EMPNO,ENAME,DEPTNO FROM(SELECT ENAME,EMPNO,
    DEPTNO,SAL FROM EMP ORDER BY SAL DESC) WHERE ROWNUM<=3 AND SAL IS NOT NULL;
    i would like tune this query or anyother new qeury find out top5 salary.
    By
    SivaWhy do you need to Tune? What do you need to tune?
    What is the execution time of the query? What is the explain plan?
    Moreover, in an International forum, refrain from using Locals. 10 Lakhs = 1 Million.
    Do provide the above details to determine if your query needs tuning?
    Below is a correct version of Top N query. Untested for your example. Please do modify according to your needs.
    SELECT ROWNUM,
      SAL,
      EMPNO,
      ENAME,
      DEPTNO
    FROM
      (SELECT ENAME,EMPNO, DEPTNO,SAL, dense_rank() over(order by sal desc nulls last) dr
        FROM EMP ORDER BY SAL DESC
      ) a
    WHERE a.dr <= 5;Regards,
    P.

  • Need to find out the account group given the accounting document number

    I am new to SAP. Please help.
    Need to find out the account group given the accounting document number?

    If you are asking about account assignment group then that can be seen in billing document -> Header -> Accounting Data.

  • Need to find out the queries which did not executed in 2014

    Hi All,
    I need to find out the queries which start from YY  and did not executed in 2014, earlier we used to find out by looking into the technical content cube 0TCT_C02 but now its giving dump as number of queries increases. I tried to find out using table RSZCOMPDIR but not able to trace it exactly. Please suggest some alternative solution to find out the queries which did not execute in 2014 so that we can delete it.
    Thanks,
    Asim.

    Hi,
    RSDDSTAT_OLAP : This is the table which contains query execution details
    CALDAY field in that table gives you query execution date
    OBJNAM gives the query name
    As you said RSZCOMPDIR gives list of all queries. doing a lookup between these tables will identify the queris which are not executed in particular period.
    -Sriram

  • Need to find out the number of Master data records transfered to the BW

    Hi,
    We need to find out the number of Master data (example -0MAT_PLANT_ATTR) records to be transfered to BW side. This is a delta extract.  We are preparing test scripts to check the master data extract ( full & delta) from ECC6 TO BI 7.0..
    Advance Thanks.

    Hi,
    Goto RSA3 and run that master data extractor in D mode if you want to know the number of records in delta and in F mode if you want to know the Full volume. But make sure that you set data records/calls and the display extr calls numbers so that you get the total number of records.
    The other option is goto the master data source table and look at the number of records in that table. That'll give you an idea of the total number of records in the table.
    One other option is to goto RSA7 , select the delta datasource and hit the display button. You'll get to know the number of entries in the delta queue that way as well.
    Cheers,
    Kedar

  • HT201320 I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. H

    I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. Help!!

    Yahoo's servers are notoriously unreliable. Use the "Yahoo" account type when setting it up. If it doesn't work, and you are positive the credentials are correct, wait a while and try again.
    While you're waiting, set up a free gmail or iCloud email account.

  • Is there any way to find out the dependency information for column of view?

    Does Oracle provide some view / table / pl/sql pkgs to find out the dependency information for column of view ?
    For example, there are two table mytable1 (col1 varchar2(10), col2 date) & mytable2 (col1 varchar2(10), qty int), and there is one view myView as
    select mytable1.col1, col2, qty from mytable1 inner join mytable2 on mytable1.col1 = mytable2.col
    Can I get some information such as myView.col1 is come from mytable1.col, myView.col2 is come from mytable1.col2, myView.qty is come from mytable2.qty
    ?

    I can get the information about the columns list in table/view from ALL_TAB_COLUMNS table, but I wish to know the column in the view is come from which original table's column.
    Is there any way to find it out from Oracle meta data / through any PL/SQL packages ?

  • My account has been hacked and someone has ordered stuff from your site in my name. i need to find out some more information for the police. do you have an email adres that i can send my questions to?

    They have ordered for just under 100 euros!! i now need to find out more! any suggestions?!
    thanks!

    You can report a problem with unauthorized purchases >  How to report an issue with Your iTunes Store purchase
    Change your Apple ID password > Apple - Support - Apple ID

  • I need to find out  the  list of outbound made it  to the vendor

    I need to find out if the attached list of outbound  made it  to the vendor.
    and i have  list of all IDOC numbers that i need to check.  Could you please assist? how to check?
    Please do needful.
    Thanks in advance.
    Regards,
    PIneeder.

    Hi,
    If you want to check it in XI/PI check first:
    - in the abap stack transaction:
                  - sxmb_moni and filter for your sending system and idoc type
                         or
                  - idx5 fill in the date when the idoc was sent and the idoc number from the sending system and through double-clicking you will get to the same message as in sxmb_moni
    - in the runtime workbench (only if the communication with the partner is done via a java based adapter (all except xi,http and idoc) go to the runtime workbench and then click on message monitoring and filter for your messages. If the status there is succesfull then you can safely assume that the message was delivered to the partner. Note: it sometimes happens that a PI server also has one or more decentral adapter engines. In this case you need to check if your communication channel is deployed on any of them (you can check that in the Integration Builder) and then select the corresponding one in the Runtime workbench -> Message Monitoring -> Message from Component.
    Hope this helps,
    Horia

  • Need to find out the traffic coming into and going out of ALSB

    Hello,
    I would like to know if there is a way to find out the traffic coming into and going out of ALSB (Number of Messages). Please let me know if i am not clear.
    Thanks,
    Varun

    I would like to know if there is a way to find out the traffic coming into and going out of ALSB (Number of Messages). Please let me know if i am not clear.There are two points. If you want to get aggregate traffic for all end-points in OSB, then out of box is not possible.It can be arrived at using monitoring capabilities.
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/operations/monitoring.html
    If you are looking at the traffic at end-point level, then it is available when monitoring is enabled.
    Cheer
    Manoj

  • How to find out the features/available in a particular version

    Hi
    thanks in advance. I am a novice user. I am using oracle 8.1.7. How can I find out the commands/ features rellated to this version of SQL.

    Hi Devmiral
    Thanks for the links that are of great help. akadia.com is full of resources But I faced one problem as most of the analytical functions did not work on 8.1.7 like rank, dense_rank, running total etc etc
    I have a celeron laptop with 256 MB of RAM and installed oracle 8i database. working on sql is comfortable, but can I install SQL 9.0.1 or higher on this laptop and operate at the same speed.
    I do not want to install the whole of Oracle 9i or Oracle 10g, my objective is to practice all the 9i/10g features of SQL installing the minimum of SQL engine.
    Is it possible, if possible then do let me know the methods or procedure.
    Thanks

  • How to find out the set handler for a particular signal?

    I have an interesting puzzle to solve. l'm investigating problems with someone else's code and I'd like to get the name of the handler that is set for SEGV. psig shows that the process catches SEGV, however I don't have access to the source code for all the libraries it links against and none of the source code I have sets a handler for SEGV. Is there a way to find out the name of the signal handler that is set for a particular signal in a process? I'm sure the source was compiled with cc -g. Solaris 8

    Hello Haritha,
    Please follow the path.
    Go to RSA1 -> Metadata Repository ->DataStore Objects(ODS) -> Find you DSO(ODS) there and click on that, you will get all the details(Queries, Objects - Char, Key figures, update rules,etc..) related to that particular DSO(ODS), same is the case for Cube as well.
    Please assign points.

  • How to find out the provider information of a cell phone (from deceased relative)

    Hello all!
    I have an odd sort of question that I am hoping for some help on.  My wife's uncle recently passed away and we are now in possession of his old cell phone.  He was slightly estranged from the family and didn't share a lot of information so we currently have no idea whether this phone is prepaid or if it uses a service provider.  We would like to find out who the provider is, if there is one, so that we can cancel service, but are not sure how to go about doing this.  We have been unable to find any information on his phone as of yet.  Is there any way that this information can be found?
    Thank you so much for the help!

    http://http://www.peoplesmart.com/phone
    Enter the number, the next screen will show the provider.
    Other option, just call *611 from the phone

  • Help me to find out the brushes information?

    Is it possible to find out wheather the "textframe" and "stroke" contains the "Brushed object" or not in "illustrator cs" through javascript or vbscript. Please help me.

    Anybody please!

  • Find out the locking information

    Hi,
    In oracle form, if a user tries to update a record which has been locked by others,
    it will automatically shows the locking error.
    How can I achieve it if I want to show the locking information such as the user who
    locked the record instead of the simple locking error.
    Many thanks in advance.
    Ivan

    Look at
    Re: How to find the lock on a record??

Maybe you are looking for

  • EJB 3 as a Web service

    Hi there, Please guide me on how to expose EJB3 as a web service? My enviornment is WAS(Web sphere application Server) -6.1.0.17 RAD-7.0.0.5 I am using JAX-WS for creating web service. I have installed Web service feature pack for both JAX-WS and EJB

  • Date error during creation of asset master using bapi

    Hi All, Am creating asset master using BAPI_FIXEDASSET_OVRTAKE_CREATE ,, but am getting date problem while passing value  '21022005'  ( or any date )  in the format  'ddmmyyyy'  the error says 'the capitalization date is invalid' .... the capitalizat

  • I have a question about getting a Bluetooth module installed on my MacPro Desktop running 10.6.8.

    I have the following MacPro Desktop. Model Identifier MacPro1,1, with two Dual-Core Intel Xeon Processors at 2.66 GHz. I have 4 GB of memory. There is not a Bluetooth module installed, but I would really like to be able to disconnect from my Logitech

  • How to moniter the max quantity of used dialog work process in our SAP syst

    Dear Gurus, The quantity of Dia Work Process(DWP) of APP1 is: 16 (rdisp/wp_no_dia=16) The quantity of Dia Work Process(DWP) of APP2 is: 16 (rdisp/wp_no_dia=16) The quantity of Dia Work Process(DWP) of APP3 is: 20 (rdisp/wp_no_dia=20) The quantity of

  • Fastest way to view clips

    I have a hard drive camera and it creates hundreds of clips. I want to look at each clip and then create subclips. Is there a way to speed up the process of opening up each clip individually and then setting my in and out points? Can I put them all i