Without the help of trade unions

Is there a way to avoid a union query (which means two full table scans) for the following:

Here's the whole upward:
create table x
(number (2) id,)
leftid number (5),
rightid number (5)
);

insert into x values (1,11111,11111);
insert into x values (2,11111,22222);
insert into x values (3,22222,33333);

And here's the query:
SELECT id, leftid, 'left' of x
Union
SELECT id, rightid, 'right' of x;


The paintings that I have are huge and for the performance, I'd rather not have the table read twice, but always get the result set in the union above query... Thank you!
ID LEFTID SIDE
---------- ---------- -----
1 11111 LEFT
1 RIGHT 11111
2 LEFT 11111
2 RIGHT 22222
3 LEFT 22222
3 RIGHT 33333
SQL> select  *
  2    from  x
  3  /

        ID     LEFTID    RIGHTID
---------- ---------- ----------
         1      11111      11111
         2      11111      22222
         3      22222      33333

select  id,
        case lvl when 1 then leftid else rightid end sideid,
        case lvl when 1 then 'LEFT' else 'RIGHT' end side
  from  x,
        (select  level lvl
           from  dual
           connect by level < 3
        )
/

        ID     SIDEID SIDE
---------- ---------- -----
         1      11111 LEFT
         2      11111 LEFT
         3      22222 LEFT
         1      11111 RIGHT
         2      22222 RIGHT
         3      33333 RIGHT

6 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • Is it possible to group several columns individually without the help of the union?

    Hi, if I have a table with a column numebr I want group, for example, sex, nationality, age and I want to present a summary of this kind:

    County group
    10 male
    23 women
    British 19
    14 Irish
    18 10

    ...
    etc.

    Or even better:
    County group
    10 men
    Sex-wife 23
    British Nationaility 19
    14 Irish
    10 to 18 years

    Is it possible without using loads of trade unions? I just want to do the best way and most effective the table involved has > 100 million lines.

    Thank you very much

    Jen :)

    Hey, Jen,

    Here is another way, which could be faster because it does not unpivot data:

    SELECT    CASE  0
               WHEN  GROUPING (gender)       THEN  'Gender'
               WHEN  GROUPING (nationality)  THEN 'Nationality'
               WHEN  GROUPING (age)         THEN 'Age'
           END                    AS label
    ,       COALESCE ( gender
                   , nationality
                 , TO_CHAR (age)
                 )           AS val
    ,       COUNT (*)          AS cnt
    FROM       t
    GROUP BY  GROUPING SETS ( (gender)
                              , (nationality)
                   , (age)
                   )
    ORDER BY  label
    ,            val
    ;
    

    Output, using the data of knapen:

    LABEL           VAL                    CNT
    --------------- --------------- ----------
    Age             25                       2
    Age             30                       2
    Age             40                       2
    Age             45                       2
    Age             50                       2
    Gender          F                        5
    Gender          M                        5
    Nationality     BRITISH                  4
    Nationality     INDIAN                   3
    Nationality     IRISH                    3
    
  • How Downgrade of El Capitan in Yosemite without data loss and without the help of a Time Machine?

    I, are looking for an answer to this question, but couldn't find one.  If there is an and missed it, please tell me and I will look happily on it.  I want to do it without the help of a Time Machine, because I used it at the time of Yosemite.  And I discovered that you can use a cable USB or SD to come down, but how do you do this without losing all my data?

    You must save, erase the drive, install Yosemite, restore your backup of the data

  • How to create a box the size of the artboard without the help of a script

    HI -.

    Is there a way to create a box to the size of the artboard automatically, without the help of a script? FOR EXAMPLE. something I can build in action. Ive been able to create the box using a script, but we can not save the script in action, so unfortunately that there's no help for me

    What I want to do is

    1 open the file

    2 create box with no filling, no race, making the size of the box of the artboard

    3. run the rest of an existing action

    Greatly appreciate any help, I want to run on more than 10,000 cases per year.

    Using slices may be slightly inaccurate, Carlos (no offense intended).

    Here is another approach:

    Rectangle_Artboard_Size.AIA - Google Drive

    The action was created in Illustrator CS5, so no guarantee that it works in CC2015.

    Two prerequisites are necessary:

    -Alignment on work plan should be on (pallet alignment).

    -L'option divide and outline will remove unpainted work should be disabled (see Options Pathfinder).

    In older versions of Illustrator (I think of CS3), we could make a simple gesture of the 2 step using the object > acreage > make order, then the cultivated area > Release. It is not possible in recent versions of Illustrator.

  • query: without the help of the union

    Hai, everyone,

    IHAVE àtable like this:

    Table1:

    ID emp1 emp2 emp3
    1 100 200 300
    2 90 295 977
    3 150 299 500




    and I need the result like this:

    100
    90
    150
    200
    295
    299
    300
    977
    500



    the result is just union emp1, emp2 and emp3

    That is to say, this type of result, we can produce with this:

    Select emp1 in table1 union select emp2 emp3 union table1 select from table1

    but I need a query with the same result as above without using the union statement

    Thanks in advance...

    Published by: jp_valapad on Sep 12, 2008 02:38

    Published by: jp_valapad on Sep 12, 2008 02:39

    But the order guaranteed?

    N ° as it is never without an order by ;)
    But op didn't say anything about a particular order (again)...

  • Trace channels by name without the help of a script.

    Hello

    I'm looking to draw channels, by using a report model, without having to rely on the index of each channel. I am processing the data from different sources and although they have the same marking convention for certain types of channels, some sources generate unique channels that can shake the index, and I have to manually put the parcels on the right channels.

    Is there a way around this without the use of scripts?

    Thanks for any help.

    Kevin

    I think that you can configure your report models as they reference channels by name, as opposed to the number.

    I have not used but check it out

    
    

    Or try this

    On the report tab, go to settings > Layout Set Up > layout settings and I believe that you change the channel reference it as well

  • How to get the values in a single line, without the help of the union

    Hello

    I have a table with the structure and the following data

    EmpID address phoneno emailid
    1001 xyz
    1001 1234234
    1001 [email protected]
    1002 23434
    1002 [email protected]
    1003 abcd
    1003 [email protected]
    1004 [email protected]



    I need to get a result in this format.


    EMP id address phoneno emailid
    1001 xyz 1234234 [email protected]
    1002 23434 [email protected]
    1003 abcd [email protected]
    1004 [email protected]


    I can do this by using the union, but who gives a performance of questions with a large table. I want to do it using any other way using lead or something, but with the relative to data complexity, I couldn't do it.

    Can someone help me please?


    Natarajan

    Published by: Nikita on December 3, 2009 15:50
    Select employee_id, max(address), max(phone), max(email)
    from emp
    group by employee_id;
    

    Max

  • II you need VERY basic instructions on how to stop a program from running at startup, without the help of Windows Defender.

    I have a Vista operating system, I use Firefox as my browser and I have MS Security Essentials, I turn off my Windows Defender.  I want to disable some programs from starting automatically, but I can't figure out how do it when I can not use this feature in Windows Defender.  I'm not at all read and write or experienced in computers or software, so PLEASE keep this in mind.  I really need advice for flush on a kindergarten, with each specific step the easiest way, so I can understand & follow him.

    Thank you for your help in this matter, as well as for your understanding of my limitations.

    CA DJ

    Hello

    Without knowing the programs you want to disable, I'll start by saying that I can't be responsible for adverse effect to the normal operation of your system.

    That said...

    • Click Start
    • Type msconfig and press enter
    • Click on the Startup tab

    You will see checkboxes for programs that run at startup.

    Or you can use a more comprehensive tool called autoruns...

    http://TechNet.Microsoft.com/en-us/sysinternals/bb963902.aspx

    Maybe is a better way to explore the settings for the programs themselves, there is often a check box for "do not run at startup.

    Tricky

  • Is there no way to just select text in DW CC 2015 and put it in capital letters without the help of CSS?

    A simple question. I'm just trying to select specific text and put it in capital letters without having to use CSS and without having to retype. I don't see an option for this in 2015 CC DW anywhere. Either I'm blind or there is simply no. I swear that this is in the older versions however.

    I have a list with the addresses and has been invited to be the first lines in capital letters. There isn't a ton of work to just retype, but it seems that it could be simplified. I guess I could just use CSS, but it seems unnecessary to me. Anyway, any help is appreciated.

    It does not exist as an option, as the ability of InDesign to highlight the text, then click on the button in the toolbar.

    However, the use of css to do is quite simple...

    Your text here

    Depending on how your addresses are arranged, you may be able to do much easier using the: first-line pseudo selector in your .css file.

  • How can I download pictures without the help of Photos?

    V10.10.5 using OS X Yosemite with pictures v1.0.1. I would like to upload RAW files without having to import through Photos, because I want to change them. Unfortunately, I was not very successful. While exporting pictures (RAW) images in a folder, the images have been converted to jpg. :-(

    Therefore, how can I download photos from my camera without using pictures?

    Download from where to where?

    Usually you download using Safari or another web browser and click load and select the RAW file wherever you downloaded it to disk

    If you talk about form of import a mount of the camera the card in a card reader and use the finder to copy the files to the location you want RAW format - or use Image Capture to import them to any desired location

    And importing RAW woes not convert them to JPEG using the finder, transfer of images or Photos - each of these copy the RAW file as that disc for your use, you choose

    LN

  • How can I remove another account icloud without the help of the person?

    Hello, I need to delete an account from an ipad icloud. I had my nephew stay and he added his account for ipad from my mom, who she would now like to use. Unfortunately, it is unlikely to help me remove. There is no nice way to explain the situation, but basically, he stole a lot of things and ended up in prison. I have a number of crime when it was stolen, but the ipad was never because he did not leave the property. Of course, the ipad is not sound, is anyway apple will be able to help me? Thank you very much

    If you were the original purchaser of the iPad (i.e. he not was purchased used) then you could try to go to an Apple Store (make a Genius Bar appointment if you do) or try to contact iTunes Support Online (http://www.apple.com/support/itunes/contact/) and see if they can remove the iPad on the account - they are likely to want to see proof of ownership before they could for example help original receipt with the serial number top

  • How do I export my favorites PC Firefox to my Firefox Android WITHOUT the help of Firefox Sync

    I do not wish to go through the laborious process, poorly described to install Firefox Sync. All I want to do is to have available on my Android Tablet PC Firefox favorites.

    Hello jantheman49, it is not possible without sync - however, this should only take a few minutes to install: How can I set up Sync on my computer?

  • How to copy DAQmx task without the help of MAX?

    Howdy-

    I hit a bit of trouble here I think points to a fundamental misunderstanding I can have on DAQmx channels and tasks.  I can hack together a workaround, but I would like to know how to do these things, common sense.

    In a Word, I prefer to do everything in the code and not use MAX.  For my application, I would like to create a single channel/task initialized with all the scaling, the physical channel parameters and units (it is what is, in my case, a 'channel').  I would then like to create copies of this channel/task and configure each with parameters of specific task of sampling... corresponding to what I would call the "tasks" to use "Channel".

    I'll have no chance, so of course, I do not understand what I do.  Any reading/posts I've met use MAX.  Here's what I've tried so far:

    Even when you try to use MAX, I am the breath.  Any help straightening on my confusion here is very appreciated.

    Thanks in advance and have a nice day.

    -Brad

    In fact, you're not confused.  In this instance of National Instruments is perhaps...

    See the links ofthese ideas in the link.

    But a 'task' is really just a section in an XML file.  If this file is named *.lvproj the project has access to tasks.  If this file is *.nce any labview application has access to tasks.  If this file is created by the RTE that vi has access to the task.  In short, the "tasks" are never really defined by 'Code' but by the XML code to the file than declairs them and teir properties.  Tasks need to be defined a time-preference during design - project

    Yes, it's a bit simplistic but a good analogy!

    Go ahead and kiss MAX to set your tasks... use DAQmx property nodes if you need to programmatically determine a task property.   "do everything in code" as you say is just not really the way it is... the way I think you hear it...  'S really not 'made it in the code"but rather how LabVIEW is inherintly multithreaded.  The IDE just handles it for you "So easy that could encode a cave man!  Relax and let it work the way it does work for you.

  • Is it possible to configure a HP Office Jet 7500 a without the help of its touchscreen?

    I bought a hp officejet 7500 used a. When I went to use, I found that the touchscreen does not work. to top it off, the printer has been reset to factor settings and I can not run setting the screen on the printer. is there a way I can set up the printer? on a side note, it seems that if there were some manipulations with the screen.

    Hi korey07,

    Unfortunately if he brought to initialization, and you are unable to select the language it will not detect.  With the screen in this hardware configuration of State of the façade will not be successful. I can send you the steps for a semi full reset by private message, but if the screen is completely insensitive, it won't work. It will take you agree to not post the stages.  Since you bought the device, it will most likely be out of warranty, the status can be checked here.  If you have tried all of the solutions in the documentation of the material of the last message, contact HP technical support to explore all options based on the status of the guarantee. Global coordinates can be found here.

    I hope this helps!

  • System repair of Windows XP Embedded without the help of his CDs?

    I use a CCTV using the Windows XP Embedded platform. Recently, due to some problems, I'm not able to boot the system and that's what suggests to repair windows using the CD because of the missing "C:\WINDOWS\SYSTEM32\CONFIG\SYSTEM" file I have lost my CD of Windows XP Embedded, but I have original Windows XP CD. Can I use the Windows XP CD and repair system?

    For this error, always start with a chkdsk/r from the XP Recovery Console.

    The question was preceded by a loss of power, aborted reboot or abnormal termination? (This includes the plug pulling, buttons power and removing the battery).

    These can cause corruption in the file system that must be fixed before you do anything else.

    If none of these events occurred (or even if they have not taken place), you must verify the integrity of your file system before anything else (especially "try" things).

    There is zero logic to begin to try to begin to try to modify or copy files to a hard drive that has a corrupted file system, so this must first be fixed using the XP chkdsk program and run chkdsk on your hard drives may solve your problem completely.

    Use the XP Recovery Console to check the file system on your HARD drive and fix the problems and then try to start your system - this may be all you need to do.  Or, you are welcome to just start trying things that might work.

    Boot into the Recovery Console Windows using an XP bootable installation CD.

    If you have no XP bootable media (or aren't sure you have) create a bootable XP Recovery CD of Console and don't forget (no support for XP not necessary).

    This is not the same as recovery disks that might have come with the acquisition of the system store.

    You can make a bootable Recovery Console CD by downloading an ISO file and burn it to a CD.

    The ISO bootable image file you need to download is called:

    xp_rec_con. ISO

    Download the ISO from here:

    http://www.mediafire.com/?ueyyzfymmig

    Use a new CD and this simple and free program to burn your ISO file and create your bootable CD:

    http://www.ImgBurn.com/

    When you install ImgBurn, DO NOT install the Ask toolbar.

    Here are some instructions for ImgBurn:

    http://Forum.ImgBurn.com/index.php?showtopic=61

    It would be a good idea to test your bootable CD on a computer running.

    You may need to adjust the computer BIOS settings to use the CD-ROM drive as the first device to boot instead of the hard drive.  These adjustments are made before Windows tries to load.  If you miss it, you will need to restart the system again.

    When you start on the CD, follow the instructions:

    Press any key to boot from CD...

    Installing Windows... going to pronounce.

    Press 'R' to enter the Recovery Console.

    Select the installation that you want to access (usually 1: C:\WINDOWS)

    You may be asked to enter the password (usually empty).

    You should be in the folder C:\WINDOWS.  It's the same as the

    C:\Windows folder that you see in Solution Explorer.

    The Recovery Console allows base as file commands: copy, rename, replace, delete, chkdsk, fixboot, fixmbr, cd, etc.

    For a list of the commands in the Recovery Console, type help at the prompt of commands or read on here XP Recovery Console:

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

    A good idea before you start things must first verify the integrity of your file system by using the chkdsk command.

    In the command prompt window, run the chkdsk command on the drive where Windows is installed to try to fix any problems on the afflicted player.

    Running chkdsk is fine, even if he finds no problem.  It won't hurt anything to run it.

    Assuming your boot drive is C, run the following command:

    CHKDSK C: /r

    Let chkdsk finish to correct the problems, he could find.

    It may take a long time for chkdsk complete or they seem to be "stuck".  Be patient.  If the HARD drive led blinks always, chkdsk is something.  Keep an eye on the amount of the percentage to be sure that it is still making progress.  It may even seem to go back sometime.

    You must run chkdsk/r again until it finds no error to correct.

    Remove the CD, and then type "exit" to exit the RC and restart the computer.

    You have not to set the BIOS to boot the disk HARD since the CD won't be.

Maybe you are looking for

  • phone lost on screen home-iPhone 6 icon

    All of a sudden, the phone icon who has always been in the lower right of my home screen is missing. When I drag from left, I can see it under 'Siri Suggestions' (so I can at least make calls), how can I get that back. It was accidentally added to an

  • Nobody knows what a folder called talagent?

    I'm trying to figure out what uses more memory on my laptop which is almost out of memory.  Which is the best way to achieve this.  Is - this activity monitor?  When I go into that, I see a folder called talagent with 74 MB of memory.  Does anyone kn

  • Site Web auto find on firefox 4

    In firefox 3.6 I could type for example "avatar imdb" in the address bar and it would take me to the page on avatar the movie on imdb.com but in firefox 4 need me just to google How can I put it as if it was in firefox 3.6?

  • Satellite L675: characters show twice and delay keypad when typing

    For some reason, there always seem to be a delay seconds on the keys of the keyboard, including the numeric keypad. Several times, has been ignored, a character or the character appeared twice.Vey frustrasting that I always come back to add or delete

  • Window error when you export the mp3 file

    I have used audacity for awhile with no problems... now all of a sudden I can't export to a cd.  What has changed or gone wrong?