Merging two separate Tables into One - different number of rows

Hi. I have a problem. Oracle 10.2.0.4.0
7 years ago when i was learning how to query my teacher told me that is possible to creata some kind of report where results could be combined in 1 view(report) witch in different variable could have different number of rows.
I just remember that there is needed to use group by function and some join?
Please help
In link there is a sample sample view
I need to combine Table A using D variable with Table B to become Wynik(result)
Tables create
CREATE TABLE "TABELA_A" ( A NUMBER,B NUMBER,C NUMBER,D NUMBER ) ;
INSERT INTO "TABELA_A" (A, B, C, D) VALUES (123, 1, 70, 999)
INSERT INTO "TABELA_A" (A, B, C, D) VALUES (123, 2, 80, 999)
INSERT INTO "TABELA_A" (A, B, C, D) VALUES (234, 1, 100, 111)
INSERT INTO "TABELA_A" (A, B, C, D) VALUES (456, 1, 10, 222)
CREATE TABLE "TABELA_B" ( D NUMBER,E VARCHAR2(255),F NUMBER ) ;
INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'A', 1);
INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'B', 1);
INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'B', 3);
INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'C', 1);
INSERT INTO "TABELA_B" (D, E, F) VALUES (111, 'A', 1);
INSERT INTO "TABELA_B" (D, E, F) VALUES (111, 'C', 2);
And to become result - in picture
[http://i303.photobucket.com/albums/nn153/katanbutcher/pytanko.jpg?t=1306152636]
Thank's for help
Edited by: 860710 on 2011-05-23 05:42
Edited by: 860710 on 2011-05-23 05:54
Edited by: 860710 on 2011-05-23 06:07

Maybe if you follow the instructions mention in this post you may get some help. For example, I wouldn't try to click on the link provided by you.
SQL and PL/SQL FAQ
Regards
Raj

Similar Messages

  • How to configure GG to merge two source tables into one destination table?

    I have two tables at source (say S1 & S2), I want to merge these tables and replicate to a single target table (Say T1).
    Does GG support this type of replication? If so, could any one let me know how to configure Table and Map parameters?
    Thanks in advance.

    It is possible. In the extract capture both the tables.
    Extract parameter
    table s1;
    table s2;
    Replicat parameter
    map s1, target t1, keycols (...);
    map s2, target t1, keycols (...)

  • Overlay and Merge two separate PDFs into one PDF

    Hello
    I have a master single page PDF, which has a hole in it where variable text/images will appear.
    The variable text/images is also supplied as a single page PDF (there are 9000 of these files).
    Is there a way using JavaScript to automate the process of overlaying the variable text PDFs onto the master PDF and saving out as 9000 combined single page files?
    Any help greatly appreciated.
    Kevin

    It can be possible with Acrobat JavaScript's template object, but it appears you would need to insert your master page into the 900 text/image pages, make the master page a hidden template, and then overly the template.

  • HT204053 Can you merge two Apple IDs into one?  It was a common issue caused by the iPhone 4 and has been corrected, but transferring purchases in iTunes is a pain with two IDs.

    For a brief time when iPhone 4, iOS 4 came out, many of us ended up with two Apple IDs.  I want to know if anyone can please provide me with simple step-by-step instructions on merging two Apple IDs into one?  It would make transferring purchases on iTunes much easier and reliable.  I realize i desperately need an iOS update, but i had no laptop for over two years!  I'm posting a cry for help on that in another community.  Thank you all.

    No,
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.

  • Merge two PDF files into one with Adobe Reader

    Does anyone know how to merge two PDF files into one with Adobe Reader. Is it even possible?
    Thanks

    If you've got a Mac and OSX you can do this in Preview.  Make sure you can see the sidebar with the first PDF opened, and then drag the second PDF to the bottom of the last page in the sidebar.  Also you can reduce the size of your saved file by selecting (or making) a Quartz filter to 'reduce file size'
    Cheers

  • How to merge two storage drives into one partition-help

    THis is on an iPad-Please excuse for any typos
    I Am working on a project of restoring a macbook pro from old parts that I found. It works!!! But the HDD that i salvadged is ancient and gets about .15 MBPS. Not good. Its an apple certified and apple branded toshiba HDD-500G at 5400RPM. Yeah. *****
    I am considering buying a new hard drive as a 480GB SSD, and using OWC's Data doubler, adding a second HDD, for all the photos and vids i will be collecting through my work in video and photo. I am considering getting an SSHD (SSD+HDD in an SSD form factor) and using this as the second drive. its not much more expensive (like 10$ more) and itgetsme semi-SSD like performance on a mass scale of storage.
    HOw can I combine these two drives into ONE partition? 480GB will take awhile to fill up, but this is a future proof wall to use.
    I Will eventually invest in an external storage option (2-3 HDDS in one caddy for backups and storing 1080p video all under one roof. depends if the board im using actually has thunderbolt or usb that is fast enough-because of the crappy hdd i cant get it to boot into an OS or go through usb recovery without it freezing. I ahve tried re-applying thermal paste, still doesnt help)
    HOw can i easily partition these two drives into one?
    also, my friend needs a new HDD because bootup times in his macbook pro are at like 2 mins+ and hes running Core 2 Duo, with 8 G ram and 10.9 (Mav) should i recommend an SSHD or an ssd. (He doesnt want an HDD, hes had bad 'voodoo' with em'. Thanks!

    nithya_ram wrote:
    Give me d source code for merging two img files into one img file\\
    If you want someone to do your work for you, simply pay someone. However, if you have a question about code you're currently working on, feel free to ask a specific question here on the forum.

  • Merge two differents tables in one new structure

    Hello guys,
    How can I merge two differents tables in one new structure (workarea) dynamically?
    For example, merge MARA and MARC in a new structure that contains all fields from MARA and all fields from MARC.
    In this case, it isn't necessary that identical fields be repeated (MATNR).
    Can you help me?
    Thanks!
    Kleber

    Hi,
    Use include structure like:
    data begin of itab occurs 0.
            include structure MARA.
            include structure MARC.
    data end of itab.

  • Insert PDF into new Adobe Form - merging two PDF files into one

    Hi everyone,
    I need to enable access to archive PDF files but within a new PDF file containing header and footer.
    Request is not to change archived PDF files at all.
    I use Web Dynpro application to upload PDF file and to display new PDF file.
    I thought converting archive PDF files into JPG files and than using an 'Image Field' object to display those in a new PDF file.
    I am dealing here with PDF version 1.3 files.
    I am also having trouble converting these PDF files into JPG files. Any sugestions one this problem?
    Does anyone have any suggestion on how to deal with this concerning the fact that archive PDF files can not be changed?
    Is there some other way to merge two PDF files into one using Adobe Designer?
    Regards,
    Amel

    Hello, Lukasz:
      I am also facing similar requirement from my customer.
      And I found one useful blog, hope this blog can help you.
      http://wiki.sdn.sap.com/wiki/display/WDJava/CombinePDFfileswithWebDynproforJava
      Best regards, Nick.

  • Merging two LDAP directories into one clean 10.4 server.

    What I have now is two different OD masters. One is a 10.3.9 server and the other is a 10.4.9 server. What I want to do is combine the two Open Directories into one on a brand new Xserve 10.4.9 install, and make that my only master with several replicas.
    I'm trying to do as much research as possible before attempting this feat. I haven't been able to find much on here via searching. I did however, find this link (http://www.afp548.com/article.php?story=20050615173039158&query=migrate), which should be quite helpful, but I was wondering if anyone on here had anymore input.
    Thanks in advance.

    Hi Celia
    I think you could achieve this using slapcat with a bit of ldapadd/ldapmodify? Manual pages should tell you more?
    Not done it myself with 10.5 but I don't see why not? Export desired information as LDIF file(s). You could do it for for both LDAP Servers and then bring them in. They should just add to each other?
    Worth a try?
    Tony

  • How do i merge two pdf files into one

    How do i merge 2 pdf files into one.

    Open up the first pdf in Preview
    Then from Menu
    select from Edit Menu
    Select Insert (your choice of)
              Page from Scanner
              Page from File (select your PDF file)
              Blank Page
    You can then save as your first file or rename it

  • How do you combine two separate paths into one?

    I have two two separate paths that overlap and I want to combine into one path. How do I do that?

    I've now worked it out thanks it thanks. I highlighted the main path and the outer path to the second one and clicked on merge shape components. Then highlighted the inner path and did the same and this has worked.

  • Merge two PDF files into one

    I have two separate PDF slideshows created with Photoshop Elements with 1-100 and 101-200 images that I would like to combine into one slideshow with 1-200 images. How can I do this? The actual number of images in each slideshow is quite large, so that Elements cannot create the combined one, only the two separate slideshows.

    You can try this service from Adobe: http://createpdf.adobe.com/
    Or you can download the free 30-day trial version of Acrobat.

  • Merging two Queires result into one.

    I have to get two different result on the same table.First Result will be get first then added by Second result
    SELECT distinct cust.custid,cust.firstnm,cust.nextactiondt,cust.priorityscr,cust.lastacssts FROM Customer cust, Custqueue custqueue
    WHERE cust.custid=custqueue.custid AND custqueue.qcd = 'A'
    AND trunc(cust.nextactiondt)>=trunc(current_date) AND trunc(cust.lastacssts)<trunc(current_date)
    ORDER BY cust.nextactiondt,cust.priorityscr desc
    Custid            Name     Nextactiondt   priorityscr      lastacssts
    *65 A     16-JUN-11     11.52     14-MAR-11*
    *84 B     16-JUN-11     1.38     14-MAR-11*
    *93 C     17-JUN-11     0     18-APR-11*
    SELECT distinct cust.custid,cust.firstnm,cust.nextactiondt,cust.priorityscr,cust.lastacssts FROM Customer cust, Custqueue custqueue
    WHERE cust.custid=custqueue.custid AND custqueue.qcd = 'A'
    AND trunc(cust.nextactiondt)>=trunc(current_date) AND trunc(cust.lastacssts)=trunc(current_date)
    ORDER BY cust.lastacssts,cust.nextactiondt,cust.priorityscr desc
    Custid            Name     Nextactiondt   priorityscr      lastacssts
    *59 S      16-JUN-11     1212     16-JUN-11*
    I want to club the result of the two query into 1 as follows.
    Custid            Name     Nextactiondt   priorityscr      lastacssts
    *65 A     16-JUN-11     11.52     14-MAR-11*
    *84 B     16-JUN-11     1.38     14-MAR-11*
    *93 C     17-JUN-11     0     18-APR-11*
    *59 S      16-JUN-11     1212     16-JUN-11*
    but when i am using UNION
    SELECT distinct cust.custid,cust.firstnm,cust.nextactiondt,cust.priorityscr,cust.lastacssts FROM Customer cust, Custqueue custqueue
    WHERE cust.custid=custqueue.custid AND custqueue.qcd = 'A'
    AND trunc(cust.nextactiondt)>=trunc(current_date) AND trunc(cust.lastacssts)<trunc(current_date)
    UNION
    SELECT distinct cust.custid,cust.firstnm,cust.nextactiondt,cust.priorityscr,cust.lastacssts FROM Customer cust, Custqueue custqueue
    WHERE cust.custid=custqueue.custid AND custqueue.qcd = 'A'
    AND trunc(cust.nextactiondt)>=trunc(current_date) AND trunc(cust.lastacssts)=trunc(current_date)
    ORDER by 3,4 desc,5
    I am getting
    Custid            Name     Nextactiondt   priorityscr      lastacssts
    *59 S      16-JUN-11     1212     16-JUN-11*
    *65 A     16-JUN-11     11.52     14-MAR-11*
    *84 B     16-JUN-11     1.38     14-MAR-11*
    *93 C     17-JUN-11     0     18-APR-11*
    but that is different from what i expect
    Custid            Name     Nextactiondt   priorityscr      lastacssts
    *65 A     16-JUN-11     11.52     14-MAR-11*
    *84 B     16-JUN-11     1.38     14-MAR-11*
    *93 C     17-JUN-11     0     18-APR-11*
    *59 S      16-JUN-11     1212     16-JUN-11*
    so any one know how can i append the results of two queries into one since i have order by clause in both queries and i can club them together.
    Any help regarding this would be appreciated

    Look at the following example:
    SQL> select * from emp
      2  where deptno=10
      3  order by job;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
    SQL> select * from emp
      2  where deptno=20
      3  order by ename;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
    SQL> with q1 as (
      2  select * from emp
      3  where deptno=10
      4  order by job),
      5  q2 as (
      6  select * from emp
      7  where deptno=20
      8  order by ename
      9  )
    10  select * from q1
    11  union all
    12  select * from q2;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
    8 rows selected.Max

  • HELP...want to merge two itunes accounts into one running several ipods

    Hi, I need advise as I have two Itunes accounts for my family running on tow different laptops with win7 and with two iphones and two itouchs. I do I merge all this into one account that I can access from all devices and all computers?

    Do you have a home network? You can set up itunes Home Sharing and transfer your purchases that way. You need to authorize each PC for the two different STORE accounts to transfer each account's purchases.
    If you don't have a home network you'd have to use an external hard drive or USB stick.
    Long story short, there's no automatic way to do it. You need to keep track of each account's purchases and what PC they are on, then move them to the PC that is missing those items.
    There are some 3rd-party programs like Tune Ranger that say they will keep everything insync from one PC to the next, but they cost around $20 or $30.

  • HT5625 How do you merge two Apple IDs into one account?

    I have two Apple IDs (it's a long story) with mixed content.  I'd like to merge the accounts into one account, in order to synchronize my apple products.  How do I do it?

    1. Click here and ask the iTunes Store staff if they'll do it. They probably won't.
    2. Because Apple generally doesn't permit that.
    3. Because the content remains associated with your Apple ID when you share it with other people.
    (102945)

Maybe you are looking for

  • Calling different Applications w/o having to enter login info again.How ?

    Hello, we have created several apex applications that are in different workspaces. Each application has it's own custom authentication process and a login form. Now we want to have a central login form, from which user can login and be able to visit

  • Split jms messages ?

    Hi, Can anybody please advice as to how to split the messages while receiving in a jms queue ? I have a receiver jms communication channel and I need to split the messages so that in the outpout we should get 50 records per message. Also, each messag

  • Cant find moved folder of bookmarks

    I have multiple pulldowns on my favorites bar that previously looked in c:\mel\doccuments and settings\%20and%20settings\mel\favorites\links\handy which was initally chosen by firefox at installation " I think" Due to a technician rearranging my syst

  • Canon 5D Mark II Export Issues

    So, I shot some footage on the 5D and have edited them together. Every time I try to export the footage it always turns out choppy or lags. It's not as smooth as the original footage even though I set the export settings to 30 fps as is native to the

  • Qosmio X775 - CPU usage is over 99%

    I have a Qosmio x775 and while (im not gonna lie) i was playing LoL, somehow evverything started to go slower. My mouse barely moved, so i quit everything and turned off my qosmio. Then i turned in again and the problem got worse. It took like a minu