What is the syntax for displaying tree based on a correlated subquery

I need to show an effective dated tree. The reference date for the tree will be selected by the user. To do this I use a subquery to correlated against the underlying table with the entry into force provided as a bind variable. The following statement returns I want:

SELECT a.tree_id, a.tree_pid, a.tree_leaf_name
OF cit_fin_organization one
WHERE a.effective_date =
* (SELECT MAX (a1.effective_date) *)
Cit_fin_organization A1
WHERE a1.tree_id = a.tree_id
AND a1.effective_date < =: f164_point_of_view_date)


Adding where clause at the APEX generated SQL for the tree:

Select "TREE_ID" id,
* "TREE_PID" pid, * "
* 'TREE_LEAF_NAME name, *.
*'f ? p = & APP_ID.:51: & SESSION. : NO::P51_TREE_ID :'|| "' Link TREE_ID" *
null a1,
null A2
of ' #OWNER # '. " CIT_FIN_ORGANIZATION ".

is simple, but I did not come with the syntax that will successfully pass the SQL with aliases to the parser. Without references alias the request with its correlated subquery does not return, of course, the correct results.

Can someone show me the correct syntax or suggest another way to accomplish what I want to do?

-Rick

Hello

I don't have the structure of the table that you have, but the following works on the EMP table:

select a.empno id,
       a.mgr pid,
       a.ename || ' ' || TO_CHAR(HIREDATE,'DD/MM/YYYY') name,
       null link,
       null a1,
       null a2
from EMP a
where a.HIREDATE <= (SELECT MAX(b.HIREDATE)
FROM EMP b WHERE a.empno = b.empno and b.HIREDATE <= TO_DATE(:P19_HIREDATE,'DD/MM/YYYY'))

P19_HIREDATE is just a list of selection with all the HIREDATEs in the format DD/MM/YYYY. Of course, this isn't a thing of real but life shows you can use aliases and the elements of the page.

Andy

Tags: Database

Similar Questions

  • What is the syntax for "not contains"?

    If there is a syntax for <? If: contains(XMLtag,'word to look for')? >

    example: <? If: contains(TableField,'table')? > OK <? end if? > where TableField value is "table Chair fabric.

    y at - it a syntax for <? If: does NOT contain? >?

    Thank you

    Just use "not()" as
    fix

  • What is the syntax for creating a global temporary table using a select query

    HII
    I create a global temporary table using a select query... How to speak of "on commit preserve rows ' who?


    create a table temporary global t1 select * from trn_ordbase on the lines of commit preserve;

    but this is an invalid syntax, then how to talk on commit preserve rows in this? If I don't mention, by default its recital on the validation of deleted rows.

    Please help me on this problem.
    create global temporary table t1 on commit preserve rows
      2  as select * from dual;
    
    Table created.
    
    TUBBY_TUBBZ?
    
  • What is the syntax for onMouseOver?

    I have an instance of the object called thumbnail1 with the following code...

    This ["thumbnail1"] .onPress = Function () {/ / code here works perfectly ;}}
    This ["thumbnail1"] .onMouseOver = this ["thumbnail1"] .displayHoverState ();

    When the user hovers over my object, I want my object to call the displayHoverState() function. Why it doesn't work?

    I think that the 'onMouseOver' syntax is incorrect. Since it is not highlighting the appropriate in the Panel code color.

    onRollOver is the right method. and displayHoverState() must be a function defined on the chronology of this.thumbnail1.

  • What is the syntax to add a form element to a Web App entry form?

    What is the syntax to add a form element to a Web App entry form?  (Web Apps > > Layout > > Edit Template)

    for example: If you need a form text element should look like this: < input type = "text" value = "{tag_some-name}" / >?

    Which would look like if assuming a {} tag_image-upload tag or a group of radio buttons to boolean a type of entry in 'file '?

    Confused seriously, but he could learn quickly w / a link or an example!

    TIA

    You can not simply add any random field here, it doesn't work like that. This form is based on the fields that the web application has. If you just go through and add the form of entry web application and it has all the fields you need to send an item of web application.

  • What is the syntax to create segments?

    Hello

    segment can be created manually as table space? If Yes, what is the syntax to create the segment?

    Concerning

    The create table statement has a storage clause that is part of the clause of physical attributes.

    These clauses to define options for the creation of segment/measure. If you do not specify the storage clause, then the tablespace-level settings are used.

    Documentation of the CREATE TABLE statement

    Physical properties: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#i2126711

    {[deferred_segment_creation] [table_compression] segment_attributes_clause}

    [inmemory_table_clause] [ilm_clause]

    | [deferred_segment_creation] ORGANIZATION

    {Heap_org_table_clause BUNCH [segment_attributes_clause]

    | INDEX index_org_table_clause [segment_attributes_clause]

    | External_table_clause EXTERNAL

    }

    | CLUSTER cluster (column [, column]...)

    Segment attributes clause: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#i2214991

    {physical_attributes_clause

    | TABLESPACE tablespace

    | logging_clause

    }...

    {Clause of their physical characteristics: https://docs.oracle.com/database/121/SQLRF/clauses007.htm#SQLRF30011}

    [{ PCTFREE whole

    | Whole PCTUSED

    | INITRANS whole

    | storage_clause

    }...

    ]

    Term of storage: https://docs.oracle.com/database/121/SQLRF/clauses009.htm#CJACEJGB


    STORAGE

    ({ INITIAL size_clause

    | Size_clause NEXT

    | MINEXTENTS whole

    | MAXEXTENTS {integer |} UNLIMITED }

    | maxsize_clause

    | PCTINCREASE whole

    | Whole FREELISTS

    | FREELIST GROUPS around

    | OPTIMAL [size_clause |] NULL ]

    | USER_TABLES { KEEP |} RECYCLE | DEFAULT }

    | FLASH_CACHE { KEEP |} NO | DEFAULT }

    | ENCRYPT

    } ...

    )

    However, the create table statement lets you not create segments or extensions directly. New extensions are to be created initially (when the table is created) or later, when more space is needed for the table, usually after several insertions that filled the original measure.

    Also remember that SQL is a language of generation 4. But there is no need to go into details such as the management of use or storage. All that and managed by the RDBMS.

  • What is the reason for the tablespaces exist?

    Hello

    If I can store in a tablespace of data of different users / schemas / apps and also a user data / shema / application in several storage spaces. What is the meaning of a tablespace?

    What is the reason for the tablespaces exist? Only to assign the storage space and know where are the objects of the user? Is it not possible to work with data directly files instead of doing with the tablespaces?

    I'm afraid I'm too philosophical today but I do not understand why the structure of the tablespace.

    Hello

    Apart from the above, I'll add the storage capacity of a Tablespace.

    A Tablespace usually (default is a petit_fichier Tablespace) can have up to * 1022 * data files. And (in the case
    petit_fichier Tablespace) each data files can be big 4 MBlocks.

    So if your db_block_size is 8 KB your Tablespace can store up to 1022 x 4 M x 8 KB ~ 32 to data.

    More, these 1022 data files can be located on separate disks. So it can give you plenty of opportunity.

    However, from 10g you have a new type of Tablespace: bigfile Tablespace.

    Bigfile Tablespace has only 1 data file, but it can reach 4 GBlocks. So finally this Tablespace can store
    also 32 to (for 8 KB db_block_size) but, ensure you that your OS platform and system disk can support
    a big Datafile.

    The syntax for the statements that manage the data of a bigfile Tablespace file are too different. In fact, you can
    manage this data at the level of the Tablespace file.

    Please find attached a link to bigfile Tablespace:

    [http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/tspaces002.htm#ADMIN01102]

    Best regards
    Jean Valentine

  • What is the procedure for upgrading Thunderbird ESR 17.0.7 at 31.6 on Mac OSX 10.10.2?

    What is the procedure for upgrading from Thunderbird ESR 17.0.7 at 31.6 (last public version) on Mac OSX 10.10.2?

    Is it as simple as install new version and then run to see all local folders and my email and its folders from IMAP to my company as before the upgrade?

    Thank you

    Create a full backup of your Thunderbird profiles folder.
    Uninstall the old version of ESR.
    Download the latest version from https://www.mozilla.org/en-US/thunderbird/all.html and install it.

  • I use my MacBook Air as a desktop computer. Should I leave the charger plugged all the time or should I drain the battery and then recharge? What is the best for the battery?

    I use my MacBook Air as a desktop computer. Should I leave the charger plugged all the time or should I drain the battery and then recharge? What is the best for the battery?

    Keep the computer plugged in whenever possible.

    If you keep the computer always connected, make sure that at least twice a month

    Run it on battery until battery charge level falls to about 40-50%.

    Please don't completely discharge the battery. Discharge the battery completely will reduce wear and tear on the battery.

    For more information:

    Section: To optimize the battery life

    http://support.Apple.com/en-us/HT204054

    Citing at the bottom of the linked article.

    "The question is often asked:" should I disconnect my laptop from the mains when not in service? Under normal circumstances it should not be necessary because as soon as the lithium-ion battery is full, a properly functioning charger will stop the load and load the pad will only engage when the battery voltage drops to a low level. Most of the users do not remove AC power, and this practice is safe. »

    http://BatteryUniversity.com/learn/article/bu_808c_what_the_user_can_do

  • I just bought a keybboard ultra thin logitech for iPad air. It has a port for a small cable, but no cable in the box. What is the port for, and what don't get me?

    I just bought a keybboard ultra thin logitech for iPad air. It has a port for a small cable, but no cable in the box. What is the port for, and what don't get me?

    Have you tried the Logitech support site?

  • Photo, what are the criteria for images selected from the collections of photos?

    With Photo on my Mac when I'm in the view "of the years', I see all my photos. When I switch to 'Moments' I see all the photos, especially older. When I go to "collections", then I self pictures? What are the criteria for images selected in 'collections' of photos? Thank you

    You should see all the photos in the Moments, the years, Collections, unless you have the "Summarize" option enabled in Photos > Preferences > General.  Then some pictures will be omitted, but the rules are not documented.

  • What is the recommended for El Capitan recovery process?

    What is the recommended for El Capitan recovery process?

    I just upgraded directly from Mountain Lion, and I see that my recovery disc has disappeared.  My recovery disk wizard is only good for Lion and Mountain Lion.  I searched Apple.com and found a complicated process by which I could use the Console and create a bootdisk with the option reinstall, but I can't believe that this is the recommended option for a common user?

    So is time machine bygones?  I noticed that it is dimmed in the Menu bar?

    Certainly, you can restore El Capitan as you would with any other version of OS X - using the HD Recovery. I have no idea why your Recovery HD disappeared. Usually this would cause by user error. However, you can create a standalone install OS X on a USB FlashDrive for emergency use. This has been an option because at least Mavericks:

    Do your own installation of El Capitan using the El Capitan tool flash drive:

    You can create an installer of flash of El Capitan via the Terminal drive. El Capitan has its own manufacturer Installer integrated that you use via the Terminal:

    You'll need a freshly partitioned and formatted at least 8GBs. USB flash drive leave the name of the flash drive on the system by default, "Untitled." Do not change this name. Wait as the full process that will take some time.

    Open the Terminal in the Utilities folder. Copy and paste the following line in its entirety in the Terminal window.

    sudo/Applications/Install\ OS\ El\ Capitan.app/Contents/Resources/createinstallmedia--volume/Volumes/Untitled--applicationpath X\ "/ Applications/install OS X El Capitan.app.

    Press RETURN, enter the admin password (will not resonate to the window) then press RETURN again.

    You must have setup in your Applications folder or change the paths in the command line above.

    You can do the same thing for Yosemite by making the appropriate substitute for the installer in the above command line:

    Make your own Yosemite flash Installer drive using the tool of Yosemite:

    You can create an installer of the Yosemite via the Terminal flash drive. Yosemite has its own manufacturer Installer integrated that you use via the Terminal:

    You'll need a freshly partitioned and formatted at least 8GBs. USB flash drive leave the name of the flash drive on the system by default, "Untitled." Do not change this name. Wait as the full process that will take some time.

    Open the Terminal in the Utilities folder. Copy and paste the following line in its entirety in the Terminal window.

    sudo/Applications/Install\ OS\ Yosemite.app/Contents/Resources/createinstallmedia--volume/Volumes/Untitled--applicationpath/Applications/Install\ OS\ Yosemite.app X\ X\

    Press RETURN, enter the admin password (will not resonate to the window) then press RETURN again.

    You must have setup in your Applications folder or change the paths in the command line above.

    In addition, to Yosemite and earlier you can try using DiskMaker X.

  • What is the Code for error AHT 4HDD/11 / 40000004:SATA (0,0)

    What is the Code for error AHT 4HDD/11 / 40000004:SATA (0,0)

    This means you have a hardware problem related to the hard drive. The disk may be corrupted or fails and must be replaced. Save your file as soon as POSSIBLE. If the player does not have little time for the backup.

  • What is the workaround for the Smart keyboard ESC key?

    What is the workaround for the Smart keyboard ESC key?

    For what purposes? In any application, or even the home screen, hold down the "Command" key to view the list of keyboard shortcuts that work specifically with this app.

    Thank you for using communities of support from Apple!

    Ryan

    iPad Keyboard Pro & Smart, iOS 9.2

  • What is the syntax and command options registry RegKeyDel?

    What is the syntax and command options registry RegKeyDel?

    http://multicommander.com/docs/MultiScript/functions/registry

    That's all I found (in English).

    SC Tom

Maybe you are looking for