Querry with connection by

Hi all, I have a few question

with tab (c1, c2, c_from, c_to) as)

Select 'donnees_1', 'data_2", 1, 3 of all the double union

Select the option 'data1_1', 'data1_2', 1, 2 all the double union

Select 'data2_1', 'data2_2', 1, 4 double

)

Select * from tab;

This query present a simple fact

C1 C2 C_FROM C_TO

------- ------- ---------- ----------

donnees_1 1 3 data_2

data1_1 data1_2 1 2

1 4 data2_2 data2_1

Data I expect is:

c1 c2 c3
donnees_1data_21
donnees_1data_22
donnees_1data_23
data1_1data1_21
data1_1data1_22
data2_1data2_21
data2_1data2_22
data2_1data2_23
data2_1data22_24

I know I have to use connect by, but don't know how

Hello

In fact, you need not CONNECT BY for this problem or any other problem.  Nothing you can do with CONNECT BY you can also do it with a WITH recursive clause.  CONNECTION is much simpler for some problems, but not for this one.

Depending on your needs, here's a way:

WITH r (c1, c2, c_from, c_to, c3) AS

(

SELECT c1, c2, c_from, c_to

1 c3

TAB

UNION ALL

SELECT c1, c2, c_from, c_to

c3 + 1 AS c3

R

WHERE c3< c_to="" +="" 1="" -="">

)

SELECT c1, c2, c3

R

ORDER BY c1, c2, c3

;

Output:

C1 C2 C3

------- ------- ----------

data1_1 data1_2 1

data1_1 data1_2 2

data2_1 data2_2 1

data2_1 data2_2 2

data2_1 data2_2 3

data2_1 data2_2 4

data_2 donnees_1 1

data_2 donnees_1 2

donnees_1 data_2 3

Tags: Database

Similar Questions

  • Equium M40x does not work with connected AC

    Hi all

    I have a laptop Toshiba Satellite M40x-189, there little about 2 years and recently I have problems with it.

    The laptop when it is connected to the Board, the green light appears, but after 5 seconds it laptop turn off. the looks of dead battery, because it does not load normally, I keep connect and disconnect the AC, so that the orange light appear sometimes, sometimes for 5 seconds only. It's frustrating. When the drums come to start getting free he takes forever to be full. just at the moment where there is a load on the battery, that I can work on the laptop, even with the connected AC, but instead to use the AC laptop running on the battery, which usually lasts less than an hour, and then it's the bit of history.

    All I need is just to work with connected AC, because I normally just use the AC.
    Well I don't know what the problem is, can someone help me please

    Hello

    For me, it looks like a problem with the electronic power supply on the motherboard.
    I don t think that there is an adapter of wit AC problem itself or with the bad connection between the power supply and the Commission.
    If the AC adapter would malfunction the battery would not charge. But charges of battery, it collects a very slowly but it charges

    Finally I n t think you can do something you go to the service of your country. In such cases you re on the right side

  • Bad Audio quality of Blue Snowball with Connect

    I am using a microphone snowball blue with Connect, with sound quality terrible. With other software (for example, Camtasia) quality sound is big, so the microphone is OK.

    My suspicion is a mismatch of sampling, as Snowball uses a parameter fixed 16-bit/44.1 kHz. Can I set this up in connect?

    Stefan BR

    Found the solution. In the preferences, the option "use audio improved" (or similar - I use the German version, this is it: Voreinstellungen > Mikrophone > "use Verbessertes Audio") must be disabled.

  • How we would use the apps with connecting them to creative cloud and it is not not a trial.

    How we would use the apps with connecting them to creative cloud and it is not not a trial.

    Log, activation, or connection errors. CS5.5 and later, Acrobat DC

    Mylenium

  • Performance issue with connection of a level query

    Hi I have a problem with connection by level in oracle.

    My table is:


    J_USER_CALENDAR
    --------------------------

    USER_NAME FROM_DATE TO TO_DATE COMMENTS
    -------------------------------------------------------------------------------------------------
    Comment1 5 November 09 uma Shankar 2 November 09
    Veera 11 November 09 13 November 09 Comment2
    Commnet3 17 December 09 uma Shankar 15 December 09
    Vinod 20 October 09 21 October 09 Comments4


    The table above is the calendar of user authorization.

    Now I need to view the users who are on leave between November 1, 2009 to November 30, 2009

    The output should look like:


    USER_NAME FROM_DATE COMMENTS
    ---------------------------------------------------------------------------------
    Comment1 2 November 09 uma Shankar
    Comment1 3 November 09 uma Shankar
    Comment1 4 November 09 uma Shankar
    Comment1 5 November 09 uma Shankar
    Comment2 Veera 11 November 09
    Comment2 Veera 12 November 09
    Comment2 Veera 13 November 09

    For this, I tried with the following query, but it takes too long to run.
    Select FROM_DATE, user_name, comments from (SELECT distinct FROM_DATE, user_name,
    Comments FROM (SELECT (LEVEL) + FROM_DATE-1 FROM_DATE, TO_DATE, FIRST_NAME |) » '|| LAST_NAME
    user_name, COMMENTS OF J_USER_CALENDAR
    where
    and J_USER_CALENDAR.IS_DELETED = 0
    CONNECT BY LEVEL < = TO_DATE - FROM_DATE + 1) has) where ("FROM_DATE = 1st November 2009 ' or FROM_DATE = November 30, 2009")
    or FROM_DATE between November 1, 2009 "-November 30, 2009") order of from_Date, lower (user_name)

    Please help me.

    Thanks in advance.

    Kind regards
    Phanikanth

    I have not tried to analyze the SQL statement.

    Here is a test set in place:

    CREATE TABLE T1(
      USERNAME VARCHAR2(30),
      FROM_DATE DATE,
      TO_DATE DATE,
      COMMENTS VARCHAR2(100));
    
    INSERT INTO T1 VALUES ('Uma Shankar', '02-Nov-09','05-Nov-09','Comment1');
    INSERT INTO T1 VALUES ('Veera','11-Nov-09','13-Nov-09','Comment2');
    INSERT INTO T1 VALUES ('Uma Shankar','15-Dec-09','17-Dec-09','Commnet3');
    INSERT INTO T1 VALUES ('Vinod','20-Oct-09','21-Oct-09','Comments4');
    INSERT INTO T1 VALUES ('Mo','20-Oct-09','05-NOV-09','Comments4');
    
    COMMIT;
    

    Note that I have included an additional line, when the person starts their vacation in the previous month and ends in November.

    You could approach the problem like this:
    Assume that you want to appear every day in a given month:

    SELECT
      TO_DATE('01-NOV-2009','DD-MON-YYYY')+(ROWNUM-1) MONTH_DAY
    FROM
      DUAL
    CONNECT BY
      LEVEL<=ADD_MONTHS(TO_DATE('01-NOV-2009','DD-MON-YYYY'),1)-TO_DATE('01-NOV-2009','DD-MON-YYYY');
    

    Note that the above attempts to calculate the number of days in the month of November - if we know that the month has a certain number of days, 30 for example, you can rewrite the CONNECT BY clause like this:

    CONNECT BY
      LEVEL<=30
    

    Now, he must pick up lines of interest to the table:

    SELECT
      *
    FROM
      T1 T
    WHERE
      (T.FROM_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY')
        OR T.TO_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY'));
    
    USERNAME        FROM_DATE TO_DATE   COMMENTS
    --------------- --------- --------- ----------
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1
    Veera           11-NOV-09 13-NOV-09 Comment2
    Mo              20-OCT-09 05-NOV-09 Comments4
    

    If join us then both sets of results, we have the following query:

    SELECT
      *
    FROM
      T1 T,
      (SELECT
        TO_DATE('01-NOV-2009','DD-MON-YYYY')+(ROWNUM-1) MONTH_DAY
      FROM
        DUAL
      CONNECT BY
        LEVEL<=ADD_MONTHS(TO_DATE('01-NOV-2009','DD-MON-YYYY'),1)-TO_DATE('01-NOV-2009','DD-MON-YYYY')) V
    WHERE
      (T.FROM_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY')
        OR T.TO_DATE BETWEEN TO_DATE('01-NOV-2009','DD-MON-YYYY') AND TO_DATE('30-NOV-2009','DD-MON-YYYY'))
      AND V.MONTH_DAY BETWEEN T.FROM_DATE AND T.TO_DATE
    ORDER BY
      USERNAME,
      MONTH_DAY;
    
    USERNAME        FROM_DATE TO_DATE   COMMENTS   MONTH_DAY
    --------------- --------- --------- ---------- ---------
    Mo              20-OCT-09 05-NOV-09 Comments4  01-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  02-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  03-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  04-NOV-09
    Mo              20-OCT-09 05-NOV-09 Comments4  05-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   02-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   03-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   04-NOV-09
    Uma Shankar     02-NOV-09 05-NOV-09 Comment1   05-NOV-09
    Veera           11-NOV-09 13-NOV-09 Comment2   11-NOV-09
    Veera           11-NOV-09 13-NOV-09 Comment2   12-NOV-09
    Veera           11-NOV-09 13-NOV-09 Comment2   13-NOV-09
    

    Charles Hooper
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • After latest ios update, facing issues with connecting to my account.

    After update to ios9.3.4, I am unable to access my account of library like Safari just brings me to the home page repeatedly without allowing me to identify you. Same question is there with my other account of connection such as Wal-Mart. Someone knows a solution for this?

    Try to restart, hold down the sleep and home buttons until you see the Apple logo. If this does not help, there may be a problem with your certificates, as they are required for https connections.

  • iMac 5K (2016) will not all wake up with connected external display

    I have an iMac 27 "5K nine. My first Mac from Windows - it was a world of frustration and then most of the things I re-learned or found of alternatives for, I have a major problem of the iMac not wake from sleep. It took days to change things and we cut the field down to discover is an external monitor at the origin of the problem.

    I have a LG 23MP75 IPS monitor hooked up to 90 degrees. This is a debugging, screen bash and the cat. So I develop sites on the main iMac screen in the Sublime editor and also check the sites in the browser, and then on the external I Inspector chrome, terminal and Skype/cat stuff. When the device is connected, it works well, no problems. If she goes to sleep for a short period of time like 30 minutes or less, he wakes up. If he goes into a deep sleep (hibernation?), he don't wake. Sometimes holding the key ctrl + p + r, cmd and press work but mostly not, usually I have to pull on the power cord! for a restart. Heart-wrenching. The only solution at the present time it unplug the HDMI until I go home every day.

    The external monitor is connected through a HDMI cable that is routed into an 'active' HDMI mini-Display port adapter. I was told that the adapter is active is important after I had one active and bought assets to try to solve this problem. I read that the removal of the hibernation file may contribute to allow OS x to replace but I opened it instead and it is empty so not corrupt (sudo rm/var/vm/drag).

    If I stop and restart, the login screen is badly laid out, it has mirrored screen not extended display which is how it is implemented. See the images to compare. This makes me wonder if part of the problem is OSX being unhappy with the configuration of the monitor outside being connected?

    Here is the screen set up the config so you can see that there is nothing out of the ordinary:

    There is no strange configuration, the machine was brand new from Apple themselves, by default on the box, no restoration or something like that as I'm new to Mac.

    Can anyone offer any suggestions to fix the problem so I didn't either unplug the cable or the stop (which brings me to see the connection in horrible mirror every morning)? Any help would be greatly appreciated.

    You have 90 days of free telephone support, AppleCare, called Apple to discuss and see what solution they have? If you weren't aware that you had 90 days of support AppleCare please click on http://www.apple.com/support/complimentary/. In addition, if you haven't already, I highly recommend buying AppleCare, that extend the warranty to 3 years and 3 years of phone to provide support. If your machine ever needs repair (lets hope he never does) AppleCare pays for itself almost always on the first incident.

  • Problem with connecting to the external server

    I am currently using my iMac with Mac OS X Lion 10.7.5 2011 (11G 63). I have an external server connected to the PC of the window. I tried many times and many ways and yet the error "There was a problem connecting to the server" continues to appear.

    I checked:

    -IP address
    -No firewall
    -Access rights
    -Address external & directory servers

    I used my other new imac and macbook and they have no problem connecting.

    Is this an error in version?

    Please do help.

    Read this article on the basis of knowledge of Apple, there may be something you've missed.

    OS X El Capitan: connect to shared computers and servers for files on a network

    Also this...

    OS X El Capitan: to connect to a Windows from a Mac computer

  • Would be switching to a simultaneous dual‑band 802.11n AirPort Express correct problems with connectivity MacBook Air Wi - Fi

    Right now I use an old AirPort Express Terminal (802.11 DSSS 1 and 2 Mbps standard, 802 11A, 802.11 g specifications and a 802.11n draft specification) with AirPort Utility Version 6.3.6 (636.5). My MacBook Air (13 inches, beginning 2014) intermittently loses the Wi - Fi connection. Move to a 802.11n simultaneous dual‑band AirPort Express would correct this problem? I'd be better off with an Airport Extreme?

    AirPort Express frequently asked questions (FAQ) - Apple Support

  • E-mail has changed now faced with connection problems

    I changed my email address that I have changed ISP and now AppleTV constantly asking me to provide a password to get the updates and downloads.  I did everything as the basic instructions light up on the AppleTV but still have the problem because when the AppleTV is on, he puts up with the old email account.  Netflix works very well with the new email.  The AppleTV don't ask for an email address, just the password.

    Cash

    You must log out of your account on the Apple TV and then connect back with your new details.

  • G5 Powerpc does not start with connected external USB

    Core PowerPC G5 2.3 duel starts when I have my usb external 500 GB on drive but it works perfectly well if I boot

    with it goes off and then start and turned on after my mac started in Leopard 10.5.8 external USB is a 500 MB TARGA

    I have a WD elements 2. TB disk connected as well and I have no problem with it, it's a pain to remember to put a stop on all the time.

    Anyone have any ideas on that.

    Drive external hard there an independent supply?

    What happens if you attach externally to a different USB port?

  • Satellite L630 - 16K - mouse is debilitating with connected external cooling fan

    I pounded a L630 - 16 k with overconsumption and usage on bed so fan was broken.
    I'm a fan of base 3 external off Amazon today.
    Its connected via USB.
    I noticed today carpet mouse disabling a lot and freezes for about 2 minutes.

    Is there something I can do?

    Hello

    from my point of view, the external cooling pad might be useful, but I don't think t he would replace the internal cooling system.

    In the case where your fan is broken and doesn't work t, the affected part must be replaced.
    To do this the whole unit must be dismantled, and this could be a delicate procedure.

    From my point of view of the few so you don t have enough experience, you should not try to disassemble the camera.
    The risk of damage of the part is too high.

    You must also be a consistent cooling module.
    These parts can be ordered from authorized service partner Toshiba.

    In my opinion its worth to spend little money to order the part replaced by the engineer.
    Contact the ASP in your country and ask for help.

    Dude good luck

  • Satellite Z930 - suspend the problem with connected USB hard drive

    Hello

    Owner of a newly acquired Satellite Z930-15 X, I have a few questions/problems:

    1) suspends the work of RAM and good hibernation when there is no external hard drive connected. If there is one is connected, the laptop immediately returns back to suspend state. Is there a solution for this?

    (2) is there a way to selectively disable Bluetooth? Currently, only toggle airplane mode is available (with Fn + F8 or Windows 8 charm bar). This activates / deactivates the Wi - Fi or Bluetooth I think.

    (3) the portable computer is wobbly on reception. I put a bit of thin paper at the corner of a bottom (bottom left) so that it can be stabilized. Apparently, the problem is also mentioned in another thread. Is there a suggestion to fhix this problem?

    Thank you.

    1 / what HARD drive is connected to your laptop? When I use the external 2.5 HARD drive with my Satellite U940 I n t have problem.

    2 / I ve tested it on my machine and I noticed the same thing. When WIFI is disabled software BT is off too. I didn t find a way how to separately control adapter WLAN and BT.

    3 / I think that this issue needs to be clarified with Toshiba service. They must check and perhaps exchange rubbers inside.

  • Shift the image with connected external monitor

    Hi all.

    My old external monitor just called it a day, so I bought a new. A U28D590 of Samsung 4 k. pretty lousy video quality compared to my old, but I can live with, I got it for next to nothing.

    The big problem is the poor 'speed of feeling. " mouse cursor movement is undoubtedly lag compared to the internal screen (I use the copying video, so I can compare the screens in real time). Not much, but certainly enough to drive me crazy enough. This request veeery mouse movements delicate, almost like with an old PC if you know what I'm talking about, otherwise I 'miss' buttons and other things GUI I want to click because I overcompensate my movements, so to speak.

    The monitor is connected through HDMI. I read things about HDMI not providing the highest possible refresh. I expect better results if I connect via Thunderbolt/DisplayPort? If so, I would need an adapter mini-DP and DP. This card must meet specific requirements?

    My question is not similar to the questions of others since my internal screen is behaving properly. Any ideas?

    (If you have an idea, please do not check your answer as "good response" before checking with me, thank you.)

    mouse cursor movement is undoubtedly lag

    It's counterintuitive, but the most common cause for follow-up of the mouse lag ' uses in all cycles CPU ", does NOT slow updating the display.

    Try to run CPU screen activity showing all processes, or to download and run a report of etrecheck .

    PS > the original poster is the only person who can mark answers as "solved my problem. But it the system encourages you to do by asking wrong questions along the way.

  • Help with connecting my Satellite L10

    I have a Pro L10 of Satellite with Windows XP Pro installed in it.

    One day, when I started my laptop, a Windows logon window came and asked a password. He already had my name in the user name box but no password. I do not enter a password when I used it or had this window before, it appeared all of a sudden.

    Whenever I try to enter any pasword it says: «the system could not log...» "and when I press just OK without entering passwords it says it to load my personal profile and I see my wallpaper but then it says disconnected and just goes back to the Windows login screen.

    The windows login screen that I have has the name of 'Windows Journal' in the title bar and 3 buttons (OK, stop and Options) and has a little blue square with the letters EN in the lower left corner. When I click on options it just removes the blue square.

    I just use this notebook to learn more about computers, so I don't the have not yet connected it to the Internet and have not spared of all files or documents.
    I tried to restart in Mode without failure, last good known Configuration, and Directory Services Restore Mode but it still brings to the top of the Windows login screen.

    Please help me.
    Thank you very much in advance.

    Hello

    I don't really know what you are doing wrong, but maybe you should check this Microsoft article http://support.microsoft.com/kb/321305

Maybe you are looking for

  • KeyPress HTML5 player

    My question is quite simple, is it possible to change how ignore you video when you press the left arrow or right key in mozilla html5 player. At the moment it ignores 15 seconds instead of 5 sec standard as in all players. What I found is a video fu

  • Tecra M1 - SD cards with greater than 1 GB capactiy?

    I have a Tecra M1, the SD card reader is limited to cards up to 1 GB of capacity. Y at - it a software update available to enable higher capacity cards to be recognized?

  • portable audio does not

    I had sound on my laptop before going away for the weekend, I just turned on, no sound?

  • Music files by ripping CDs

    During extraction of CD with Windows Media (version 12.0.7601.18840) the resulting file in the part of the name of the song includes the song title and artist name and album name. How can I set up the download to place only the title of the song in t

  • New Member - moved above the Dollar Photo - having problems

    Anyone else unhappy and unable to contact Adobe After being forced to move photo dollar? I used photo dollar for two and half of the year and never had any problems. I can't get one of these stock images to work with my adobe design suite - which see