Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Posts
    2,296

    Unanswered: I stumped myself!

    You ever revisit some code you wrote and say to yourself:
    "WHAT THE HELL IS THAT?"

    well, I am trying to figure this out.
    The top query works, but why would the subquery (run alone) not work?
    PHP Code:
      1  select
      2   configuration_sid
    component_idattribute_sid,
      
    3   value_id1release_mod_type_sid,
      
    4   seqnuminherited_yn
      5  from tconfig_comp_attr_value
      6  where configuration_sid 
    4036454
      7  
    and   component_id = (
      
    8  select component_id from tconfig_component_set
      9      where configuration_sid 
    4036454 and
     
    10      (component_sidattribute_sidattribute_valueinterop_item_yn) =
     
    11       select component_sidattribute_sidattribute_valueinterop_item_yn
     12      from tconfig_component_set
     13      where configuration_sid 
    4036944 and
     
    14*       component_id ))
    topicadm@Topic_Dev> /

    CONFIGURATION_SID COMPONENT_ID ATTRIBUTE_SID   VALUE_ID          1 RELEASE_MOD_TYPE_SID
    ----------------- ------------ ------------- ---------- ---------- --------------------
              
    4036454            2            28          1          1                  262

    /* SUBQUERY doesn't work?  wtf?? */
    SQLedit
    Wrote file afiedt
    .buf

      1   select component_id from tconfig_component_set
      2       where configuration_sid 
    4036454 and
      
    3       (component_sidattribute_sidattribute_valueinterop_item_yn) =
      
    4        select component_sidattribute_sidattribute_valueinterop_item_yn
      5       from tconfig_component_set
      6       where configuration_sid 
    4036944 and
      
    7*        component_id )
    topicadm@Topic_Dev> /
         (
    component_sidattribute_sidattribute_valueinterop_item_yn) =
                                        *
    ERROR at line 3:
    ORA-00904"ATTRIBUTE_VALUE"invalid identifier 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Funny ...
    Does the third SELECT works by itself?
    Code:
    select component_sid, attribute_sid, attribute_value, interop_item_yn 
    from tconfig_component_set 
    where configuration_sid = 4036944 
      and component_id = 3;

  3. #3
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    212
    Hi,
    in my opinion subquery doesn't work becouse the table
    tconfig_component_set
    doesn't contain column ATTRIBUTE_VALUE.

    when you run whole query (included subquery) the attribute ATTRIBUTE_VALUE
    is included in the table
    tconfig_comp_attr_value
    which you select from in the top query

  4. #4
    Join Date
    Jul 2003
    Posts
    2,296
    fair enough, it seemed that way to me too.
    thanks for the feedback.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •