Can I limit the number of rows in connect by clause

Hello


I have àtable with data with two columns as

SUB MAIN
9 10
9 11
11 13
12 13

The query I use


SELECT hand, Sub
OF My_Tab
START BY hand = 9
CONNECT BY PRIOR Sub = hand

gives
9 10 also in the result

My question is can I restirct the output by specifying the child, for example in the case of 13
while I don't get a line in the output to 9-10 in there.

Thank you

Then, I think that you have no other option except intersect...
I mean generate the hierarchy for 9 times and 13 times and then perform an intersect...

with tab as
(
  select 9 MAIN,10 SUB from dual union all
  select 9 MAIN,11 SUB from dual union all
  select 11 MAIN,13 SUB from dual union all
  select 12 MAIN,13 SUB from dual
)
SELECT Main,Sub
FROM tab
START WITH main=9
CONNECT BY  Main=PRIOR Sub
intersect
SELECT Main,Sub
FROM tab
START WITH sub=13
CONNECT BY  Sub=PRIOR Main

Ravi Kumar

Tags: Database

Similar Questions

  • How can I limit the number of rows in a text input field?

    I don't want to have it scrolling. For example If the field has four lines the user is writing the fourth lineand give such ENTER or continue type up to are no longer on this line, I don't want to create in the fifth line text field. Il a do?

    An approach here is to limit the number of lines, someone else might have a different approach... "tf" is the name of the instance of the textfield object.

    tf.addEventListener (Event.CHANGE, checkNumLines);

    function checkNumLines(evt:Event):void {}
    If (TF.numLines > 4) {/ / deletion of the last typed character}
    TF. Text = String (tf.text).slice(0,tf.length-1);
    }
    }

  • limit the number of rows

    I know how to limit the number of characters that a user can enter, but is there a way to limit the number of rows that a user can enter in a textbox.

    If your textfield is multi-line (and I guess it is), it makes no sense to limit to a number of lines, unless you want to prevent having to scroll. otherwise, reduce your textfield.

    to prevent having to access you can use:

  • How can I limit the number libraries which is to find Photos

    How can I limit the number libraries which is to find pictures?

    I have about 10 libraries I've migrated opening today.

    I followed the advice I got from leonie, (level 10) below.

    Photos will create a new library of Photos in your iPhoto library.  The new library will be named as the iPhoto, with the extension ".photoslibrary" library and your original library will have a new file name extension ".migratedphotolibrary".  Rename the resulting ".photolibrary", so you will always be able to open in Aperture. The icons of libraries will change also. New photo library will display an icon of 'fan photos' with the flower of the Rainbow.


    So, I have now two files in my folder "Images".   One is called "Photo library" (these are ALL of .photoslibrary) the other is 'BACKUP ONLY iPhoto libraries' (these are ALL of .photolibrary).

    When I hold down the option key and start the Photos is to find all the libraries of two files above. How can I say Photos don't not to look in the old folder "iPhoto library"?

    This isn't a feature of Photos

    You can request that Apple itself - http://www.apple.com/feedback/photos.html - but not, it is not an option

    LN

  • Can I limit the number of audiochannels on clipimport.

    I am importing MXF and don't need 8 audiochannels. Can I limit the number of channels before importing?

    In the Preferences / Audio: default audio tracks.

    You can set the media of Mono surround what you want before you import the files.

    Its default value is set to use the file.

  • Limit the number of rows retrieved

    We have the need to limit the number of rows retrieved in a table for some users.

    We tried to put this by adding a policy that limits the number of rows. Here is the code:


    create or replace function
    usu01_access_policy
    (obj_schema varchar2, obj_name varchar2) return varchar2
    is
    d_predicate varchar2 (2000);
    Start
    If the user = "PEPE01" then
    d_predicate: =.
    "rownum < 11';
    on the other
    d_predicate: =.
    ' 1 = 1' ;
    end if;
    Return d_predicate;
    end;

    This code works well when you query the table like this:

    Select * from usu01;

    the number of rows retrieved is 10.

    But when we define a clause 'where' the query does clause 10 recovered lines before, getting only the lines of the first 10 with the condition 'where' = true.

    Is there a way to limit the number of retrieved rows from a table, but by first applying the 'where' clause to the whole table and later the ' rownum < limit ' condition?

    Thank you

    Why do you limit the number of lines of output? It is a customer number, not a database problem, I would say.
    Which should be resolved within the query itself. Using rownum without orderly subquery also return different results on each run.
    Take a look here for top - N query: http://www.oracle.com/technetwork/issue-archive/2007/07-jan/o17asktom-093877.html

    Nicolas.

  • How to limit the number of rows returned in a query

    Hi friends,
    I want to limit the number of rows returned by my request to some 10 lines. How to do this. When I try to make some 6 rows with the rownum < 10 its giving results for a particular Department and that too only... btw I'm bundling my table and includes much a table joins and will order the results of the table by a column... How to do this...

    Run it:

    select * from (your query goes here) where rownum < 10
    

    Nicolas.

  • Can I limit the number of lines of text entered into a TextArea?

    Hello

    I use Flex Builder 2 to create an application that allows users to enter text in different TextAreas and eventually create a PDF file with their different text. My only problem is that I can't limit the number of lines of text used in each text box. I can limit characters by using maxChar, but this does not take into account a user entering multiple presses "return" - this does not affect the character limit, but can result in the final PDF layout (spitting the text on page 2).

    Is there a way to keep track and limit the number of lines of text in a text box (in Flex 2)?

    (Ideally I won't disable the ability for users to use the 'back' button to create several paragraphs)

    Any help would be appreciated.

    Thank you

    Ben.

    Hello

    Try this code.

    import

     

    flash.events.KeyboardEvent;

    Import flash.events.TextEvent;

    Import mx.controls.TextArea;

    public class LimitedLinesTextArea extends TextArea {}

    private var numLinesAllowed:int = 0;

    private var moreCharsAllowed:Boolean = true;

    public function LimitedLinesTextArea():void

    {

    this.addEventListener (flash.events.TextEvent.TEXT_INPUT, textInputHandler);

    }

    override protected function keyDownHandler(event:KeyboardEvent):void

    {

    if (this. textField.numLines > numLinesAllowed)

    moreCharsAllowed =

    fake;

    on the other

    moreCharsAllowed =

    true;

    Super.keyDownHandler (event);

    }

    private function textInputHandler(event:TextEvent):void

    {

    If

    (! moreCharsAllowed)

    Event.preventDefault ();

    }

    public function the value numberofLines(value:int):void

    {

    numLinesAllowed = value;

    }

    }

  • How can I limit the number of Web sites on the new tab page?

    Is there a setting where I can limit the number of thumbnails / Web sites that appear on the new tab page? When I opened a new tab - I don't want to see tons of sites I have visited - but also, I don't want to delete them all. For example - there is a setting where the new tab page displays the last ten sites I've visited - with all my pinned sites?

    There are two settings 'hidden' for this 'grid '.

    Browser.newtabpage.Columns

    and

    Browser.newtabpage.Rows

    Type of topic: config in the URL bar and press ENTER.

    So put . browser.newtabpage in the top search bar.

    Each of these preferences in the lower panel right-click and select Edit. Then change the value default of 3 for each of these preferences to what you prefer, for "pinned" both sites all browsing history you want to appear in the 'grid '.

  • How can I limit the number of attempts to print a web page

    I am trying to find a solution to a problem on our network.
    We run several kiosk machines that allow customers to print documents and web pages. However, we find that we are wasting a lot of ink because of the user frequently sending the same print job on the printer.
    Yesterday we had someone print more than 70 pages, because they just keep clicking on print.
    I tried looking for an add-on that would solve this but was not able to find one.
    My question is this, is there an internal setting that can be changed in firefox to limit the number of prints is trying to say once every 30 seconds, or even a way to make a dialog box turns on screen saying that the print request is currently dealing and does nor print before completing the task at hand.

    Sorry, there no setting in Firefox to avoid that from happening. Once the user sees the "native print dialog" box (which is seen when you Ctrl + P for print), the operating system and the printer drivers are here.

    I saw something similar to that on kiosk / PC rental stores Office of FedEx, which inform the user of the cost per page, the user wants to send to a printer, and when the user click again to the same pages again, he asked if you want to spend another $x.xx to print a second copy. Would not too different to simply cut the printing of multiple copies of the same document and warn the user of this action.

    My advice is to discuss it with anyone who put in place these kiosks to be with.

  • How can I limit the number of connections to my PC for an incoming connection at a time. Multiple users are connected to my computer via the network.

    original title: limit incoming connections

    I want to restrict the number of connections to my pc for an incoming connection at a time.  I have several users that connect to my computer, using the same user name & password.  If someone tries to open a session, they fall out of someone who is already connected, without notice. the only solution I can think of is to limit the number of incoming connections to one.

    Hi willard.

    Your question is more complex that most seem to be on the answers. I suggest that you re-post on our TechNetforums where computer professionals can help you.

    http://social.technet.Microsoft.com/forums/en-us/categories/

    I hope this helps.

  • Can I limit the number of copies printed?

    I want to limit the number of times someone can print a document - partitions for example.

    What is possible with Acrobat plugins or third party?

    Without having to invest in protection DRM (which is very expensive) there is none

    reliable way to do this.

    If you want protection, you will need to pay for it.

    Wednesday, November 26, 2014 14:27, Philip Bauman [email protected]>

  • How can I get the number of rows in the table using Sunopsis API target in ODI 10 g?

    Hi guys,.

    In fact, I want to send an alert message as soon as the interface is run from a package. I've included alert OdiSendMail that sends an email once the interface is running.

    Could someone please tell how to get the number of rows inserted into the table the Sunopsis API target.

    I tried to use < % = odiRef.getNbRows () % >, but this has not worked for me. Since I am a beginner, could you please help out me

    This is my mail to send ODI format

    "The population of data managed to < % = odiRef.getSysDate () % >

    Total of lines in the target table is: < - need an API code-> "


    Kind regards

    Clinton

    Published by: LawrenceClinton on February 25, 2013 20:53

    Hello

    Create the project with details below variable

    Nom_de_variable: Total_Row_Count

    Type of variable: Variable discount

    Definition tab:
    Data type: digital
    Action: No persistent

    Refresh the tab:
    Schema: provide the schema of your repository to work and be

    SELECT log.nb_row
    THE journal of snp_step_log, snp_scen_step step
    WHERE log.nno = step.nno
    AND step.scen_no = (SELECT scen_no FROM snp_scen_step WHERE step_name='<%=odiRef.getPrevStepLog ('STEP_NAME") % > ')
    AND log.sess_no = '< % = odiRef.getSession ("SESS_NO") % >' code at low
    AND step.step_name = ' < % = odiRef.getPrevStepLog ("STEP_NAME") % > '

    Note: add this variable after the stage of interface in your package (after the interface anywhere you can place), you can add this variable before ODISendEmailNotification in your package

    call this varciable * #Total_Row_Count * in the Notification of ODISendEmail

    for example :

    Data has been fulfilled successfully in < % = odiRef.getSysDate () % >
    Total no of lines filled are: * #Total_Row_Count *

    it will work

    cordially,
    Phanikanth

    edited by: Phanikanth on February 28, 2013 01:13

    edited by: Phanikanth on February 28, 2013 01:14

  • Classic report limit the number of rows displayed

    Hi all

    In my application, I have a classic report that displays data from a simple query. For layout reasons, I want to limit the number of display 5 instead of the default value 15. I looked in several forums and they told me that I have to set the number of lines in the report attributes.

    But it doesn't have what I want. I'm using APEX 4.1.0 on Oracle 11 G database

    My question is: How can I limit the maximum number of lines in a classic SQL report.

    Hamertje16 wrote:
    I tried already to 5 the number of lines and number of lines (point).

    Do not set anything in number of lines (point). This is used to identify an element of the page containing the number of lines to allow users to control it. Remove * 5 * from here.

  • Limit the number of rows in a Pivot report

    Hi all

    How to limit the number of lines per page in a presentation of Pivot.

    My report has 1000 rows, and all are displayed at a time instead of having a button following after each rows of 25-50, as is the case in the tabular report.

    Pls Help!


    Thank you
    ADI

    Vincent said it nicely here:

    http://oraclebizint.WordPress.com/2008/01/17/Oracle-BI-101332-pagination-in-pivot-tables/

Maybe you are looking for