Child Keywords not following Parent

I am just new to LR and sorting out all the keywording. I have the impression that when I drag a parent keyord to an image all f the child keywords should also be added. Is this correect or have I misunderstood?
I created a parent "Girls" under which I have my childrens names as "children". When I drag "girls" to an image I just get "girls" added in keywording box. Also the numbers of images for the children" don't change.
Thanks any advice as like to get this right before I get too far!!!

So the following taken from the LR Help is just wrong or badly written?
"Keyword tags can be created as children of parent keyword tags. When applying a parent keyword tag to photos, the child keyword tags are also applied."
The implication is you apply the parent and get all children applied as well. At least I won't waste any time going down that blind alley. Thank you

Similar Messages

  • Partial selection of child does not keep parent node selected

    Hi All,
    Please help! I have a checkbox JTree which is working fine in all regard as I want except one condition i.e. if all child(leaf) of a parent are not selected parent gets deselected i.e. if we uncheck any child(leaf) node parent will get unselected even if there are some child are selected. I am posing code for the model. let me know if I need to post other codes also
    tree.setModel(new DefaultTreeModel(rootNode1) {
        public void valueForPathChanged(TreePath path, Object newValue) {
            Object currNode = path.getLastPathComponent();
            super.valueForPathChanged(path, newValue);
            if ((currNode != null) && (currNode instanceof DefaultMutableTreeNode)) {
                DefaultMutableTreeNode editedNode = (DefaultMutableTreeNode) currNode;
                CheckBoxNode newCBN = (CheckBoxNode) newValue;
                //CheckBoxNode newCBN1 = (CheckBoxNode) newValue;
                if (!editedNode.isLeaf()) {
                    int i=0;
                    //for (int i = 0; i < editedNode.getChildCount(); i++) {
                      while(i < editedNode.getChildCount()){
                         System.out.println("child count root"+editedNode.getChildCount());
                         System.out.println("child count root i"+i);
                        DefaultMutableTreeNode node = (DefaultMutableTreeNode) editedNode.getChildAt(i);
                        CheckBoxNode cbn = (CheckBoxNode) node.getUserObject();
                        cbn.setSelected(newCBN.isSelected());
                        if(!editedNode.getChildAt(i).isLeaf())
                        for(int j=0;j<editedNode.getChildAt(i).getChildCount();j++)
                         System.out.println("child count roottt"+editedNode.getChildCount());
                         System.out.println("child count root j"+j);
                         DefaultMutableTreeNode node1 = (DefaultMutableTreeNode) editedNode.getChildAt(i).getChildAt(j);
                         CheckBoxNode cbn1 = (CheckBoxNode) node1.getUserObject();
                         //cbn1.setSelected(true);
                         cbn1.setSelected(newCBN.isSelected());
                        i++;
                else{
                    boolean isAllChiledSelected = true;
                   for (int i = 0; i < editedNode.getParent().getChildCount(); i++) {
                        DefaultMutableTreeNode node = (DefaultMutableTreeNode) editedNode.getParent().getChildAt(i);
                        CheckBoxNode cbn = (CheckBoxNode) node.getUserObject();
                        if(!cbn.isSelected()){
                            isAllChiledSelected = false;
                    if(isAllChiledSelected){
                        DefaultMutableTreeNode node = (DefaultMutableTreeNode)editedNode.getParent();
                          CheckBoxNode cbn = (CheckBoxNode) node.getUserObject();
                        cbn.setSelected(isAllChiledSelected);
                if (!newCBN.isSelected()) {
                    DefaultMutableTreeNode node = (DefaultMutableTreeNode) editedNode.getParent();
                    if (node.getUserObject() instanceof CheckBoxNode)
                        ((CheckBoxNode) node.getUserObject()).setSelected(false);
              /*if (!newCBN.isSelected()) {
                    DefaultMutableTreeNode node = (DefaultMutableTreeNode) editedNode.getParent();
                    if (node.getUserObject() instanceof CheckBoxNode)
                        ((CheckBoxNode) node.getUserObject()).setSelected(false);
    });

    Hi Thomas,
    Sorry for late reply due to weekend.
    I had already tried your suggestion but it is not working. Do not know why? here is the code.
    else {
      int countselection=0;
    int t=editedNode.getParent().getChildCount();
                   for (int i = 0; i < editedNode.getParent().getChildCount(); i++) {
                        DefaultMutableTreeNode node = (DefaultMutableTreeNode) editedNode.getParent().getChildAt(i);
                        CheckBoxNode cbn = (CheckBoxNode) node.getUserObject();
                        if(cbn.isSelected()){
                            countselection= countselection+1;
                    if(icountselection==0 ){
                        DefaultMutableTreeNode node = (DefaultMutableTreeNode)editedNode.getParent();
                          CheckBoxNode cbn = (CheckBoxNode) node.getUserObject();
                        cbn.setSelected(false );}
    else if(countselection==1 && countselection<=t)
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)editedNode.getParent();
                          CheckBoxNode cbn = (CheckBoxNode) node.getUserObject();
                        cbn.setSelected(true );
    }}

  • Finding accounts where child does not match Parent acct category

    Hi,
    I have an interesting problem. There is Parent Account Group with child accounts under it. The child accounts must
    have been assigned the SAME category as the Parent account. If they are not, then they must show-up on the mismatch report.
    So, if there is a Parent Acct 1 with childacct a AND childacct b and if childacct a has category of Base and childacct b has category of offshore, while Parent Acct 1 has category of Base, then because BOTH A AND B do NOT have the same category as assigned to its parent, it should show up on report.
    I can get all children but how do this: check if any ONE acct category is NOT the same as the Parent???
    DO I have to use If AcctCATPARENT <>ANY(CHILDcate). then select Acct ID from table ....will this work??
    This is urgent, any help is appreciated!!
    Regards,
    hena

    Hello
    if you have a problem please remember to post some create table statements along with inserts to provide sample data to work with. Also, remember to show what the output is you're expecting and what you've tried so far. And finally remember that this is a volunteer forum so there aren't any urgent requests.
    anyway, isn't it just a matter of joining between parent and child?....
    WITH parent_acc AS
    (    SELECT 1 ID, 'cat a' cat FROM dual UNION ALL
         SELECT 2 ID, 'cat b' cat FROM dual UNION ALL
         SELECT 3 ID, 'cat c' cat FROM dual UNION ALL
         SELECT 4 ID, 'cat d' cat FROM dual
    child_acc AS
    (   SELECT 1 ID, 1 parent_id, 'cat a' cat FROM dual UNION ALL
        SELECT 2 ID, 1 parent_id, 'cat a' cat FROM dual UNION ALL
        SELECT 3 ID, 2 parent_id, 'cat b' cat FROM dual UNION ALL
        SELECT 4 ID, 2 parent_id, 'cat b' cat FROM dual UNION ALL
        SELECT 5 ID, 3 parent_id, 'cat a' cat FROM dual UNION ALL
        SELECT 6 ID, 3 parent_id, 'cat c' cat FROM dual UNION ALL
        SELECT 7 ID, 4 parent_id, 'cat a' cat FROM dual UNION ALL
        SELECT 8 ID, 4 parent_id, 'cat d' cat FROM dual        
    SELECT
          p.ID parent_id,
          p.cat parent_cat,
          c.ID child_id,
          c.cat child_cat
    FROM
        parent_acc p
    JOIN
        child_acc c
    ON
        (   c.parent_id = p.ID
    WHERE
         c.cat != p.cat                 
    /David

  • Moving Child keyword out from under Parent

    I've discovered that I have some Child keywords nested under a Parent keyword by mistake.  How can I disassociate them?  Also, other than when I'm generating a new keyword, how can I add a Child keyword to a Parent, other than by dragging and droping?  This becomes a bit tedious when the list becomes rather long.  Thanks.

    Miquel,
    If you are typing into the "click here to enter Keywords" box, I think you can also enter new keywords in the following format: child>parent>grandparent>etc. such that it places it correctly in the structure if the higher category keywords exist.  It is not really all that efficient but an alternative to the other suggestion (which is also not all that efficient).
    Since new keywords always end up at the bottom of my list, it is still most efficient for me to drag and drop them at the end of my session before exporting or saving.
    Jeff

  • Parent and child keywords problem

    Hi,
    in bridge cs and cs2 it was possible to click on the parent keyword to automatically include te child keywords. In cs3 it seems to be the total opposite. Clicking on a child keyword activates the parent keyword...
    Does anybody know if there is a way to have it like in the previous versions??
    Thanks,
    Florian

    Florian,
    If this is a Bridge-specific question, I recommend that you ask it in the Bridge forum. Thanks.
    Neil

  • Parent and child keywords problem cs3

    Hi,
    in bridge cs and cs2 it was possible to click on the parent keyword to automatically include te child keywords. In cs3 it seems to be the total opposite. Clicking on a child keyword activates the parent keyword...
    Does anybody know if there is a way to have it like in the previous versions??
    Thanks,
    Florian

    Hi Florian,
    I'm guessing you've seen the CS3 options for controlling how keywords are handled. They're in Edit/Preferences/Keywords.
    About your comment, "in bridge cs and cs2 it was possible to click on the parent keyword to automatically include te child keywords"... I'm sorry, but this doesn't sound correct. Normally, it wouldn't be a good idea to automatically include all the child keywords once a parent keyword were selected..
    Hope this helps,
    Brad

  • [svn] 2706: Improve the information given during parse errors by providing more context about which parent token is not expecting a particular child token to follow .

    Revision: 2706<br />Author:   [email protected]<br />Date:     2008-08-01 10:10:58 -0700 (Fri, 01 Aug 2008)<br /><br />Log Message:<br />-----------<br />Improve the information given during parse errors by providing more context about which parent token is not expecting a particular child token to follow.<br /><br />QA: Yes<br />Doc: No<br />Checkintests: Pass<br />Reviewer: Paul<br /><br />Bugs:<br /> SDK-15791 - [MXML Namespaces] Provide better error message when language tags are added as child of Declarations tag<br /> SDK-15659 - [MXML Namespaces] Error message not descriptive when Private tag is not immediate child of mxml document<br /> SDK-15669 - [MXML Namespaces] Error message not descriptive when incorrect <Library> and <Definition> tags are defined<br /><br />Ticket Links:<br />------------<br />    http://bugs.adobe.com/jira/browse/SDK-15791<br />    http://bugs.adobe.com/jira/browse/SDK-15659<br />    http://bugs.adobe.com/jira/browse/SDK-15669<br /><br />Modified Paths:<br />--------------<br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java<br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler_en.properties

    Thank you for the sympathy and the information about the Adobe.com forum Michael.
    I posted here because, to be honest, for a company that's acknowledged their installers and updaters and support needs some work, they seem very determined to obfuscate the means by which users can provide direct feedback to the company. Much like you, I've also noticed a trend in CS5 installations that mirrors the issues that were present in CS4. it's a sad state of affairs.
    As for my installation, you are also quite right to say that a clean install would have been a lot faster than what I went through with TS and it was actually my first idea. Before calling TS I'd actually read through the forums and noticed that a large number of users who were faced with my situation had no other choice but to reformat. I was just giving Adobe the benefit of the doubt and wasted 2 and a half weeks through that course of action...
    What makes this situation even more frustrating is that the installer failed on a fresh system. It was a custom-built design machine, assembled and configured by myself. The only software that had been installed on it prior to Design Premium was Firefox, an FTP client and the start of my problems, trial versions of various CS4 programs. I used trials just long enough to retire the previous design computer so that I wouldn't contravene the EULA's stipulation of not running more than one instance of software at the same time on different machines.  Turns out being honest once again penalised a legal customer.
    If there is just thing users should learn from my far from unique tale of failed tech support it's that if you ever run into a problem with the installation, don't bother calling TS, just reformat and start from scratch.  It might seem like it'll take longer to get going again, but in actuality, it's the opposite. Reformatting means you'll be up and running in about 1 or 2 days rather than 2 weeks.
    Marc

  • How does one not include parent keywords on Export?

    I am new to Lightroom and have an issue regarding keywording. I put my keywords into my RAW files. Then I export the RAW to a jpg. The jpg always includes the parent keywords of the keywords I enter for the RAW file. I do not want this to happen!! I only want the keywords I enter. There seems to be no way to prevent this from ocurring (at least none that I have found).
    So, is there a way to prevent the inclusion of parent keywords on export? In addition, is there a way to promote my sub-keywords so they no longer have parents?
    Thank you.

    I have already tried unchecking the "include on export".
    You need to uncheck "Export Containing Keywords" of the child keyword.  For example, if you have the hierarchy Places > United States, and you don't want "Places" exported, you need to uncheck "Export Containing Keywords" from the keyword "United States":
    Also, in the File > Export dialog, be sure to uncheck the option Metadata > Write Keywords As Lightroom Hierarchy.  This will stop the child keywords from getting written into the exported metadata fully qualified; e.g. the keyword will be written as "United States" rather than "Places|United States".

  • Parent Child Dimension Not displaying Name value.

    I have a parent Child attribute in my dimension.  It show the correct ID value in the reports but when I change the value from the NameColumn to be something else it still only shows the ID value. 
    I have an identical case in another dimension and it is working correctly.  However this dimension for some reason does not seem to work and I believe they are built the same way I must be missing something.  I have tried to show the OrgNodeID
    and tried to display the OrgNodename but neither displays all it displays is the intdimParentOrgNodeID.
    My dimension table looks something like this
    intdimOrgNodeID int Key (surreget key)
    intOrgNodeID int (Actual ID)
    intDimParentOrgNodeID
    intOrgNodeName
    In the Propertys I have set
    KeyColumns  = tbldimOrgNode.intDimParentOrgNodeID
    NameColumn = tbldimOrgNode.intOrgNodeID
    Parent-child values
    =NonLeafDataVisible
    =*(Direct)
    =
    =ParentIsBlankSelfOrMissing
    =(none)
    Ken Craig

    I have been pulling my hair out for days to find this and what I finally found that resolved this shocked me and I am still not sure why it would matter.  You can see below my table and then dimension info.  Although I agree my OrgNode ID attribute
    is really not needed in AS and could be removed.   In places where that is used we could instead rename the key column Dim OrgNode ID to OrgNode ID.    However why the key attribute must have the name column set to intOrgNodeID
    instead of just using the Key value of intdimOrgNodeID is what I am lost at. 
    Outside of this parent dimension I have never seen issues with this.  I want to say sometimes in the past I have seen duplicates if I use the surreget key to display the actual ID so I have normally left that as a key and just added another attribute
    to house the actual ID, like I did below. 
    Can someone explain to me this and what is the best suggested practice here.
    My table is like this
    intdimOrgNodeID int Key (surreget key)
    intOrgNodeID int (Actual ID from source and used by customers)
    intDimParentOrgNodeID (ID used for parent child (it is the Parent intOrgNodeID surreget
    key intdimOrgNodeID))
    intOrgNodeName (Source Name)
    My AS dimension is like below
    Dim OrgNode ID
    AttributeHierarchyVisible=False
    KeyColumns = tbldimOrgNode.intDimOrgNodeID (Integer)
    NameColumns= tbldimOrgNode.intDimOrgNodeID (Integer)
    OrgNode ID
    AttributeHierarchyVisible=True
    KeyColumns = tbldimOrgNode.intOrgNodeID (Integer)
    NameColumns= tbldimOrgNode.intOrgNodeID (Integer)
    OrgNode Hierarchy ID
    Usage=Parent
    AttributeHierarchyVisible=True
    KeyColumns = tbldimOrgNode.intDimParentOrgNodeID              
    NameColumns= tbldimOrgNode.intOrgNodeID (WChar)
    Change I had to make was this
    Dim OrgNode ID
    From     NameColumns= tbldimOrgNode.intDimOrgNodeID (Integer)
    to           
    NameColumns= tbldimOrgNode.intOrgNodeID (Integer)
    Ken Craig

  • DAC tasks are not running in Sync.Parent - Child ROW_WID  not proper.

    After the completion of DAC, When I tested the reports, one of the report is not populated. The root cause which I analyzed is the child table W_product_DX is not having same ROW_WID ids as parent W_Product_D and hence the join fails to pull the child records.
    When I see the log file , the custom task that populated the child table has run ahead of the parent dimension table therefore the child has not populated with new/updated roe_wid values.
    Do we have do some setting in each task so that it runs in a particular order of execution....
    Any ideas how to resolve this problem. Help appreciated. __.____

    Did you create an entirely new custom task or modify an existing one?
    If you did one from scratch you wil need to analyze the location of the other tasks and modify the order in your execution plan.
    This section of the documentation covers execution order:
    http://download.oracle.com/docs/cd/E10783_01/doc/bi.79/e10759/dacdesignetl.htm#i1041265

  • Child topics not appearing when clicked in parent project

    Hello,
    I have generated a Webhelp parent project containing two child projects in RoboHelp 9. The tables of contents appear for all projects correctly, but when I click some of the topics, they will not display, rather I get that message that my webpage cannot be found. Most of the topics work fine when clicked.
    If it helps, it seems that the topics that won't display are ones that are new or have recent edits.
    I've tried regenerating my projects and re-creating the TOCs, but I am not sure what else I can try. When I generate the child projects on their own, all topics work fine, it is only when merged as a child project in the main project that the topics won't show.
    Thanks,
    Maddy

    It looks like I was wrong, it isn't just new topics, it is a mix of old and new topics that aren't appearing.
    When I look into the folders of the generated merged topics, it looks like these topic files are not generating.
    For example:
    I generate parent project GP and its topics work fine.
    I generate parent project LR and its topics work fine.
    I generate project GP as a child project merged in parent project LR, several of child project GP's topic files have not generated.
    I tried to move the missing files from the main GP generated folders into LR's child version of GP where they should appear, but I get this message: "Cannot move file abcd: The filename, directory name, or volume syntax is incorrect".
    The topics that did generate properly, both new and old, do appear to open to the correct pages when clicked in the TOC.

  • Aperture 3: search child keywords only ?

    Hi all,
    Since a few days I am using Aperture on my iPhoto11 library. That library already had a lot of keywords, which I now have organized in Aperture using the hierarchical keyword feature. Now I would like to remove the keywords that have become parent keywords from the images (they were put there by an iPhoto plug-in) in order to keep only the lowest level keywords physically assigned to the photo's.
    My idea was to do a keyword search on any of the parent keywords and then remove these keywords from the selected photo's. Unfortunately searching on a parent keyword also selects photos that do not physically have that keyword assigned to them but have it assigned implicitely because of the hierarchical structure.
    Suppose I would have the following keyword hierachy:
    Nature
         Fauna
              Bird
                   Duck
    I would like "Duck" to be the only keyword actually assigned to a photo. Because of my legacy iPhoto library many "Duck" pictures have the other keywords assigned to them as well. To remove them, I did a keyword search for "Nature", the idea being to then remove "Nature" from the selected photos. Unfortunately when I do this keyword search, it will also show pictures that do not actually hold the Nature keyword but have it implicitely assigned because it holds one or more of the child keywords.
    What I would like is to show ONLY the images having the Nature keyword actually assigned to them. This option seems to be missing from the keywrod search dialogue, although the user manual suggests it would be possible, but in my opninion the user manual is wrong here. Under "Searching by Keyword" it states that the option "are applied" would show all images that have THE SELECTED keywords. This is not true: it will show all images that have ANY keyword applied. It is not even possible to select a keyword if you chose this option. All other options show the behaviour as described above.
    So, does anybody know how I can select only images holding a particular keyword that is actually assigned to those images and ignore the hierachy ?

    First, back-up your Library.
    Second, repair your Library -- instructions are on the Apple Aperture Trouble-shooting page.  You should, imho, _always_ repair your Library after every crash.  (Force-quitting is a user-initiated crash.)
    You should be able to batch assign and delete keywords without hanging your system.  Changing keywords for ten-thousand Images may take several minutes, but it should never crash Aperture or your system.  That problem should be addressed before you attempt to pare and clean your keyword tree.
    What is your set-up?  Aperture & OS versions, RAM, free space on system disk, location and size of Aperture Library, location and number of Referenced Originals, etc.  Has it been stable in the past?  Made any recent changes?
    Third, confirm that your system runs Aperture well, and specifically that it runs your Library well.
    Fourth -- strictly my personal suggestion -- adopt a keywording system that rigorously differentiates between "keywords as groups" and "keywords as tags".  So instead of "Nature; Fauna; Bird; Duck" use something like "=Nature=; a.Fauna; a.Bird; DuckMallard" where keywords bracketed by "=" are top-level groups, keywords prefixed with "a." are _groups_ and -- this is the rigorous part -- don't ever assign any top-level or grouping keyword to an Image.  Assign only "bottom-level" identifying keywords.
    With such a system, "DuckMallard" and "DuckPinTailed" and "DuckCanvasBack" are assigned to Images as appropriate, and each Image so tagged will be included whenever you search for any of "=Nature=", "a.Fauna", or "a.Bird".
    In this example, I suggest using the prefix "Duck" before all ducks so that when you sort an alpha list of keywords all your ducks are in a row.  If, instead, you preferred to group your ducks, make a group called "a.Ducks" and then you wouldn't need the "Duck" before "Mallard", "Teal" etc.  I found it helpful to include keywords such as "DuckUnknown" and "DuckGeneric" and "ID_Me"
    Converting your current system to this system shouldn't be much work once you have your Library working well.
    There are some refinements hidden in plain sight in Aperture's use of keywords, but let's make sure your Library is working first.  On my machine, I can filter for, say, "Fauna".  As you see, this will include both Images with "Fauna" assigned, and any Images with keywords that are children of "Fauna".  I can still select all and remove "Fauna".  The result is that none of the selected Images have "Fauna" assigned -- even though, if I filter for "Fauna" I will still be shown all the Images that have keywords that are children of "Fauna".
    HTH,
    --Kirby.

  • How to Use Messge-Pool of Child DC, in the Parent DC

    Hi,
    I am trying to achieve componentization of webdynpro projects.
    I want to use the messages stored in the Messge-Pool of child DC, in the parent DC.
    I have done the following so far:
    I have stored all the messages(error/standard) in the message pool of one DC project.
    I have created the public part of the component of that DC.
    I have Build-deploy-checkin that DC project.
    I have added that public part to another DC.
    I have successfully added it to the "used Webdynpro components" of the second DC.
    I am able to successfully pass values using context mappings, between the two DCs.
    But i am not able to use the Messges available in th message-pool of the first(child) DC.
    I added the childDC to the properties of the Views of the second(Parent) DC, but i am still not able to use the Messages present in the Messagepool of the child DC.
    Is there a way to use the Messages present in the Messagepool of the child DC, in the views of the parent DC???
    Thanks,
    Hanoz

    Hello,
    You have to use EXPORTING LIST TO MEMORY AND RETURN addition with SUBMIT stmt.
    Try like this:
    DATA:
    L_IT_LIST TYPE STANDARD TABLE OF ABAPLIST.
      SUBMIT <Child Program Name>
      WITH SELECTION-TABLE LIT_RSPARAMS
      EXPORTING LIST TO MEMORY AND RETURN.                   "#EC CI_SUBMIT
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          LISTOBJECT = L_IT_LIST
        EXCEPTIONS
          NOT_FOUND  = 1
          OTHERS     = 2.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'WRITE_LIST'
          TABLES
            LISTOBJECT = L_IT_LIST
          EXCEPTIONS
            EMPTY_LIST = 1
            OTHERS     = 2.
        IF SY-SUBRC <> 0.                                       "#EC *
    *     Do Nothing
        ENDIF.
    Hope this is clear.
    BR,
    Suhas

  • Summarize (sum) a field in a child group to a parent group section

    Can someone tell me how to insert a summary (sum) of a field in a child group to a parent group?  The column is not in the detail row, only a group section.

    Hi Mark,
    As I understand from the description, you have 2 groups(child and parent) and you want to insert summary of the field in child group to a parent group.
    Try  following........
    Go to Insert -> summary
    Insert summary based on required field and then under the option "Summary Location" select the Parent Group.
    Please let us know if you are looking for something else.
    Regards
    Ankeet

  • How to retrieve a child node's immediate parent node from a tree table?

    Hello
    Hi,
    I have a category_subcategories table, and I would like to know how to construct a sql and sub-sql for retrieving a child node's immediate parent node.
    Here is my first part of the sql, it only returns the node "Flash"'s parent and its grand-parents:
    SELECT parent.category_name, node.lft, node.rgt
    FROM category_subcategories AS node,
    category_subcategories AS parent
    WHERE node.lft > parent.lft AND node.lft < parent.rgt
    AND node.category_name = 'FLASH'
    ORDER BY parent.lft;
    | name |
    | ELECTRONICS |
    | PORTABLE ELECTRONICS |
    | MP3 PLAYERS | |
    how can I modify this query so that it returns Flash' parent - 'MP3 Players'?
    Thanks a lot
    Sam

    Hi,
    This is an Oracle forum. If you're not iusing Oracle, make that clear. Always say what version of your softwate you're using, whether it's Oracle or anything else.
    Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data. Explain how you get those results from that data.
    It looks like you're using the Nested Sets technique for modeling a tree. To get the parents of given nodes, do something like this:
    SELECT        parent.category_name
    ,       node.lft
    ,       node.rgt
    FROM        category_subcategories      node     -- Can't use AS with table alias in Oracle
    ,       category_subcategories      parent
    WHERE        parent.lft      IN (
                        SELECT     MAX (lft)
                        FROM     category_subcategories
                        WHERE     lft     < node.lft
                        AND     rgt     > node.rgt
    AND        node.category_name          = 'FLASH'
    ORDER BY  parent.lft; This should work in Oracle 8.1 and up. (I can't actually test it unless you post CREATE TABLE and INSERT statements for some sample data). You may need to modify the syntax a little for your database.
    785102 wrote:
    Hello,
    I tried to implement the solution as follow:
    mysql> select parent.*
    -> from category_subcategories as parent
    -> having parent.lft =
    -> (select max(parent.lft) from
    -> (SELECT parent.category_name, parent.lft, parent.rgt
    -> FROM category_subcategories AS node,
    -> category_subcategories AS parent
    -> WHERE node.lft > parent.lft AND node.lft < parent.rgt
    -> AND node.category_name = 'Sofa'
    -> ORDER BY parent.lft
    -> )
    -> );
    ERROR 1248 (42000): Every derived table must have its own alias
    mysql>
    But I got an error.
    What is wrong with it?What does the error message say?
    Apparantly, in your system (unlike Oracle), every sub-query must have a name. Try something like this:
    select      parent.*
    from      category_subcategories as parent
    having      parent.lft = (
                   select      max(parent.lft)
                   from     (
                             SELECT        parent.category_name
                             ,       parent.lft
                             ,       parent.rgt
                             FROM        category_subcategories      AS node,
                                    category_subcategories      AS parent
                             WHERE        node.lft      > parent.lft
                             AND        node.lft      < parent.rgt
                             AND        node.category_name = 'Sofa'
                             ORDER BY  parent.lft     -- Is this a waste of effort?
                        )  AS got_name_lft_and_rgt
                  )     AS got_lft
    ;What is the purpose of having the inner sub-query, the one I called got_name_lft_and_rgt?
    Also, in Oracle, an ORDER BY clause in a sub-query doesn;t guarantee that any super-queries will keep that order. Why do you have an ORDER BY clause in the sub-query, and not in the main query?

Maybe you are looking for

  • Excise base Value

    Hi all, Currently system calculating "Base Value" of Excise Invoice based on exchange rate maintained in OB08 in case of Import PO. Our requirement is "Base Value" should be calculated on the basis of exchange rate in PO. Thanks in advanc

  • Creating a (pdf-editable) form in InDesign

    Hi, I have several documents set up in InDesign as templates. My staff and volunteers will open the document, edit only a couple of items and print it out. The problem is that most volunteers do not have access to InDesign. I would like to be able to

  • Execption In Resuest Processor

    Hi All, I am using Java Studio 8. Whenever I use some typical classes like DefaultMutableTreeNode and try to use auto code completion by pressing ctrl+space, i get an exception "Exception occurred in Request Processor". That is, when I type "defaultm

  • ProFTPD and Arch

    Hi all, is anyone here using Arch with this FTP server? If so, I am having problems with it. Do you run it as it's own user? Since I am having problems to start it. Many thanks!

  • My iPhone sounds aren't working why is this?

    My iPhone sounds such as: Keyboard clicks, new message tones, lock sounds, new mail sounds, or any type of alerts aren't working, music also isn't audible. When I plug the headphones in I can hear everything, but without the headphone I can't hear an