using doubt connect by front

Hello
I use ORACLE 10.2.0.3.0

I have the table with columns foll
2 routes R1 and R2
R1: N1-N2-N8
R2-N1-N7-N2-N8
WITH t1 AS (SELECT 'R1' route_id,'N1' from_node,'N2' to_node,'S444554' schedule_id FROM dual UNION ALL
SELECT 'R1','N2','N8','S444555' FROM dual UNION ALL
SELECT 'R2','N1','N7','S444556' FROM dual UNION ALL
SELECT 'R2','N7','N2','' FROM dual UNION ALL
SELECT 'R2','N2','N8','S444555' FROM dual) SELECT route_id,from_node,to_node,schedule_id,LEVEL lvl FROM t1
CONNECT BY from_node = PRIOR to_node
START WITH from_node NOT IN (SELECT to_node FROM t1)

ROUTE_ID     FROM_NODE     TO_NODE     SCHEDULE_ID     LVL
R1             N1             N2       S444554             1
R1             N2             N8       S444555             2
R1             N2             N8       S444555             3---------not required
R2             N1             N7       S444556             1
R2             N2             N8       S444555             2---------not reuired
R2             N7             N2                                2
R2             N2             N8       S444555             3

now i don't need the records (which are marked with not required) coming from present query
i need the output something like 

ROUTE_ID     FROM_NODE     TO_NODE     SCHEDULE_ID     LVL
R1             N1             N2       S444554             1
R1             N2             N8       S444555             2
R2             N1             N7       S444556             1
R2             N7             N2                              2
R2             N2             N8       S444555             3
can any body help me
Thank you

Don't forget the route_id:

SQL> with t as
  2   (select 'R1' route_id, 'N1' from_node, 'N2' to_node, 'S444554' schedule_id from dual union all
  3    select 'R1', 'N2', 'N8', 'S444555' from dual union all
  4    select 'R2', 'N1', 'N7', 'S444556' from dual union all
  5    select 'R2', 'N7', 'N2', '' from dual union all
  6    select 'R2', 'N2', 'N8', 'S444555' from dual
  7   )
  8  --
  9  select route_id, from_node, to_node, schedule_id, level lvl
 10  from   t
 11  start with from_node not in (select to_node from t)
 12  connect by from_node = prior to_node
 13            and route_id = prior route_id;

RO FR TO SCHEDUL        LVL
-- -- -- ------- ----------
R1 N1 N2 S444554          1
R1 N2 N8 S444555          2
R2 N1 N7 S444556          1
R2 N7 N2                  2
R2 N2 N8 S444555          3

5 rows selected.

And thanks for the display of the sample data! :)

Tags: Database

Similar Questions

  • using you connect in front and the order of

    Hi friends
    I have a simple table, which is like the tree and its columns id, parentid and its name

    I create the shape of the tree the data in the table simply to connect before. but I want to do the sorting with order of according to name

    for example
    Table
    id     pid     name
    1       -         abc
    2       1         bbb
    3       1          ab
    ......
    my query result must be
    ABC
    AB
    BBB

    How can we use sort
    Thank you

    need to order the brothers and sisters in desc... ??

    an example

    SELECT last_name, employee_id, manager_id, LEVEL
    FROM employees
    START WITH employee_id = 100
    CONNECT BY PRIOR employee_id = manager_id
    ORDER SIBLINGS BY last_name; 
    

    Ravi Kumar

    Published by: ravikumar.sv on October 22, 2009 12:40

  • OWB - possible to use prior connection in maps

    Hello

    We get the data provided to the hierarchical table and love fill the column on the table below with the level in the hierarchy (parent, child or grandchild).

    In sql can be used to connect by front.

    Is it possible to use this map?

    Thank you

    Check this box:

    https://blogs.Oracle.com/warehousebuilder/entry/connect_by_in_owb_10gr2_hierar

  • try to use easy connect to befriend isqlplus but does not

    Using the Easy Connect naming method

    of http://download.oracle.com/docs/cd/B19306_01/network.102/b14212/naming.htm#sthref783

    I want to connect to isqlplus remotely.

    Forgive me if I ask this stupid question,

    do I need to install the oracle client to use isqlplus. If Yes, then no need to answer the question above.

    I mean with browser without a doubt, I can reach the url, but when it prompts for the connection string, I try the replace by the


    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP) (HOST = globalro-417667)(PORT = 1522))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = tomkyte)
    )

    so I wonder if I'm doing the right thing or not.

    Thank you!

    Hello

    See the link support entirely, the page which you referred it self says 'this chapter describes how to configure the connectivity information for client connections to the database server'. If the Client is required.

    Clients can connect to a database using easy connect server name if the following conditions are met:
    -Oracle Database 10 g Net Services software installed on the client.
    -Support for the oracle TCP/IP on the client and the database server protocol
    -No functionality requiring a more advanced connect descriptor is required

    Everything is there in the Document ORACLE.

    -Pavan Kumar N

  • I have five Airport extreme with their network of people names different location home.  I have a brighthouse router that I use to connect to all the extremes of the airport.  I experienced the problem of connection to the internet.

    I have five airport extreme, with their network of people of names in a different location in the House.  I have a brighthouse router that I use to connect to all the extremes of the airport.  I experienced the problem of connection to the internet.

    Are all connected to the Brighthouse router by Ethernet extremes? Are all of the extremes configured as bridges?

  • iPhone 6s use usb connections in my car

    6s IiPhone uses usb connections in my car

    iPhone devices no load carrier via the USB Ports of the music player

  • What is my Skype Id when you use facebook connect

    What is my Skype id when you use facebook connect I can not find not to give people to connect to me thank you very much

    Traore can use your generic name of Skype:

    Facebook:yourname

    where yourname is the name you use to log into Facebook.

  • How will I know if my Airport Extreme has the latest firmware?  And (not related) how to change the password used to connect to my network?

    I think I bought the latest version of Airport Extreme.  It is the unit which is rectangular, is about 6 to 7 w., etc.  I have some basic questions that I do not understand:

    1. How will I know if I have the latest firmware for this device?  I read a few posts that make it sound as if it was just automatically updates.  Is this true?

    2. can someone tell me how to change the password used to connect to my wireless network?

    Thank you very much!

    Chris

    If a firmware update is available, AirPort Extreme flashes orange.

    The most up-to-date version of the firmware is 7.7.3.

    You can see what version you currently have the following on your Mac...

    Open Finder > Applications > utilities > AirPort Utility

    Click on the image of the AirPort Extreme

    Look for the Version

    If the new firmware was available, you will see a button update here

    To change the wireless network password...

    Click on edit in the window smaller than you watched just to check the firmware version

    Click on the Wireless tab at the top of the next window

    Go back / change the wireless password and enter a new password

    Do the same thing to check

    Click Update at the bottom right of the window and give the airport a minute full for restart

  • OfficeJet Pro 8625: Which of the 4 rear usb ports can I use to connect to the computer

    There are four USB ports on the back of the printer.  Group of two ports on the top and another group of two below.

    Which of the 4 ports should I use to connect to the printer.  I intend to use the ability to fax from the printer.  Best, Aaron

    Hi Aaron,

    There is only a signle USB pet at the back of the printer, not 4

    To connect the printer to your PC, plug the USB to the USB Port rear, as shown below:

    To connect the device as a Fax, connect a phone cord from 1 d to a wall phone jack.

    Kind regards

    Shlomi

  • When a second (another) user tries to connect using the connection to distance that a message "select a user to disconnect so you can connect.

    Original title: Remote Desktop

    We have Windows Server 2012 essentials (evaluation version) installed and working.  When connecting to even via the remote desktop connection it works fine, but when a second (another) user tries to connect using the connection to remote, a message "select a user to disconnect so you can connect.  The names of the 2 users are displayed the first is the name of the administrator of the local server and the second is the remote desktop user who was first.  We need at least 3 to 4 remote desktop both users to be connected.  Please advice

    Hi BHARATISRANI,

    Thanks for posting in the Microsoft Community.

    Since you are using Windows Server 2012 Essentials, the question you posted would be better suited for COMPUTING public Pro on TechNet. I would recommend posting your query in the TechNet Forums to get help:

    Windows Server 2012 Essentials General TechNet Forums

  • Should what app I use to connect my ACER Iconia 8 tablet wireless to my Samsung TV compatible dongle?

    How can I move apps on my ACER Iconia Tablet 8 from the internal memory to the external micro-SD card installed?   Also, can what app I use to connect wireless to my Samsung TV with a dongle on this subject?

    official app from Samsung?

    https://play.Google.com/store/apps/details?ID=com.Samsung.companion

    on applications on SD card, applications of the system (the default application installed) can be moved; downloaded application can be moved if they have options.

    settings/applications

    Locate the application that you want to move, press and select move to SD card

    Note that this move (if possible) a part of the application, most of the files will remain in the internal memory.

  • Unable to use the connection to connect to broadband, help?

    I have Windows XP Service pack 2

    I turned my computer off one day and he said he would do some downloads. When I turned it back on it would not connect to the Internet. When I go to start Control Panel network connection, create a new connection, then the wizard turns on. I chose Connect on the following Internet my connection manually set and it gives me three choices

    Connection using dial-up modem that is grayed out

    Conncting a broadband connection which requires a username and password which is gray

    and it's the one I use!

    Connect using a connection Strip which is always in. It's the only one that can be cliccked and it does not work.

    Can someone tell me how to recover one using the ID and password?

    I can not connect from my computer at home at all. I use the work one, so I can't download from the Internet but if I could put it on a flash drive that would work.

    Thank you!

    BCRingler

    Hello

    Follow these steps and check if that helps:

    Method 1:

    Start the computer in safe mode with network and check if the same problem occurs:

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/boot_failsafe.mspx?mfr=true

    Method 2:

    I suggest you try to perform the clean boot and check if it helps:

    http://support.Microsoft.com/kb/310353

    NOTE: When you are finished troubleshooting, make sure that put you the computer in start mode normal as suggested article above.

    It will be useful.

  • Want to go wireless to use another connection by the web

    I have a windows xp home 2002 128 adding ram series megabits and used to go wireless to use another connection. I have a linksys router e1ooo, a con of bus. E1000 network adapter and and on the installation disc insersion, it said to go to windows update.com and download windows xp service pack 3, how can I daod load whan I.m cannot get online. If I was online in the first place, I wouldn't need to go wireless! Well Duh! Help me if you can! Gary B.

    I have a windows xp home 2002 128 adding ram series megabits and used to go wireless to use another connection. I have a linksys router e1ooo, a con of bus. E1000 network adapter and and on the installation disc insersion, it said to go to windows update.com and download windows xp service pack 3, how can I daod load whan I.m cannot get online. If I was online in the first place, I wouldn't need to go wireless! Well Duh! Help me if you can! Gary B.

    Can get you wired online? If yes go to update.microsoft.com. It will scan your computer, download and run updates.

    If this does not work, contact

    • United States: (800) 360-7561, from Monday to Friday from 05:00 to 19:00 Pacific time.

    These additional pieces and can provide you with a Service Pack disk if it is still available.

  • Closing removes all the saved passwords used to connect automatically to YouTube and Hotmail

    Moose title: stop, my sign plunges of Hotmail and You Tube, never used to give up sign ins?

    Locking computer removes all sign ins.

    Never used to do this. As always, I clicked on

    Stay connected Hot Mail and you Tube.

    How can I fix this.

    Nuts will sign in everything what it after shut down.

    Hello

    1. what browser do you use to connect to Web sites?

    2 when was the last time it was working fine?

    3. This only happens for this website or any websites?

    4 did you last modified the software on the computer?

    I suggest you to go through the steps mentioned in the link and the Coachman.

    Store passwords for automatic logon

    http://Windows.Microsoft.com/en-us/Windows-Vista/store-passwords-for-automatic-logon

    Fill in website forms and passwords automatically

    http://Windows.Microsoft.com/en-us/Windows-Vista/fill-in-website-forms-and-passwords-automatically

    I hope this helps.

  • I have problems wireless on my Acer laptop which has Windows Vista. I am able to connect to my school of university network and used to connect to my home network.

    original title: Wireless on the Fritz

    I have problems wireless on my Acer laptop which has Windows Vista.  I am able to connect to my school of university network and used to connect to my home network (both are networks limited requiring a password or log in).  However, last week my computer stopped connecting to my home network (no one else has this problem with the home network).  I tried to fix the problem, but my computer says that "Wireless association failed because Windows did not receive response from the access point or wireless router."  That said also thatthe connection "(my wireless network)" has been cancelled.  This is perhaps due to a timeout or user action. »

    The only different thing I did last week was click option at my University 'connect long-term' instead of 'connect short term' to their wireless network.  Maybe who has messed up my settings?  That's what my University said of his record long term: "students, faculty and staff also have an option to easily record their computer (or other wireless devices), so that it is not necessary to authenticate each day they connect from the network wireless campus, to resources outside the University.»  However, these settings are saved on their network (I can access it online from another computer), so I think it is unlikely that he messed up my settings.

    I don't really know what the problem is.  Any ideas as to what I can do?  I don't want to reset my computer everything.

    Thank you!

    Hello

    You can view these methods:

    Method 1:

    I suggest you to disable any program of security on your computer and check if it solves the problem.

    After reviewing the question you must reactivate the security on your computer program.
    Note: Run the computer without antivirus software or firewall is a potential threat to the computer; Be sure to activate security software after completing the troubleshooting steps and after identifying the problem.
    Method 2:
    I suggest also allows you to check in SafeMode with network.
    Method 3:
    I also suggest you to check the settings of the router firewall.

Maybe you are looking for