Can we make one query to get same results from 3 tables

CREATE TABLE TABLE1 (NODEID VARCHAR2(4));
CREATE TABLE TABLE2 (NODEID VARCHAR2(4));
CREATE TABLE TABLE3 (NODEID VARCHAR2(4));
INSERT INTO TABLE1 VALUE('1004');
INSERT INTO TABLE1 VALUE('1004');
INSERT INTO TABLE1 VALUE('1002');
INSERT INTO TABLE1 VALUE('1002');
INSERT INTO TABLE1 VALUE('1001');
INSERT INTO TABLE1 VALUE('1001');
INSERT INTO TABLE1 VALUE('1006');
INSERT INTO TABLE1 VALUE('1006');
INSERT INTO TABLE1 VALUE('1005');
INSERT INTO TABLE1 VALUE('1005');
INSERT INTO TABLE2 VALUE('1004');
INSERT INTO TABLE2 VALUE('1004');
INSERT INTO TABLE2 VALUE('1004');
INSERT INTO TABLE2 VALUE('1002');
INSERT INTO TABLE2 VALUE('1002');
INSERT INTO TABLE2 VALUE('1002');
INSERT INTO TABLE2 VALUE('1002');
INSERT INTO TABLE3 VALUE('1001');
INSERT INTO TABLE3 VALUE('1001');
INSERT INTO TABLE3 VALUE('1006');
INSERT INTO TABLE3 VALUE('1006');
INSERT INTO TABLE3 VALUE('1005');
INSERT INTO TABLE3 VALUE('1005');
INSERT INTO TABLE3 VALUE('1004');
INSERT INTO TABLE3 VALUE('1004');
INSERT INTO TABLE3 VALUE('1004');
INSERT INTO TABLE3 VALUE('1002');
INSERT INTO TABLE3 VALUE('1002');
INSERT INTO TABLE3 VALUE('1002');
INSERT INTO TABLE3 VALUE('1002');
Select count(*), count(distinct nodeid)
from table1, table2,table3
where table1.nodeid=table2.nodeid and table1.nodeid=table3.nodeid;
Select count(*), count(distinct nodeid)
from table1, table3
where table1.nodeid=table2.nodeid;
Select count(*), count(distinct nodeid)
from table2, table3
where table2.nodeid=table3.nodeid;

Aside from your insert statements not working... (should be as follows)...
DROP TABLE TABLE1;
DROP TABLE TABLE2;
DROP TABLE TABLE3;
CREATE TABLE TABLE1 (NODEID VARCHAR2(4));
CREATE TABLE TABLE2 (NODEID VARCHAR2(4));
CREATE TABLE TABLE3 (NODEID VARCHAR2(4));
INSERT INTO TABLE1 VALUES('1004');
INSERT INTO TABLE1 VALUES('1004');
INSERT INTO TABLE1 VALUES('1002');
INSERT INTO TABLE1 VALUES('1002');
INSERT INTO TABLE1 VALUES('1001');
INSERT INTO TABLE1 VALUES('1001');
INSERT INTO TABLE1 VALUES('1006');
INSERT INTO TABLE1 VALUES('1006');
INSERT INTO TABLE1 VALUES('1005');
INSERT INTO TABLE1 VALUES('1005');
INSERT INTO TABLE2 VALUES('1004');
INSERT INTO TABLE2 VALUES('1004');
INSERT INTO TABLE2 VALUES('1004');
INSERT INTO TABLE2 VALUES('1002');
INSERT INTO TABLE2 VALUES('1002');
INSERT INTO TABLE2 VALUES('1002');
INSERT INTO TABLE2 VALUES('1002');
INSERT INTO TABLE3 VALUES('1001');
INSERT INTO TABLE3 VALUES('1001');
INSERT INTO TABLE3 VALUES('1006');
INSERT INTO TABLE3 VALUES('1006');
INSERT INTO TABLE3 VALUES('1005');
INSERT INTO TABLE3 VALUES('1005');
INSERT INTO TABLE3 VALUES('1004');
INSERT INTO TABLE3 VALUES('1004');
INSERT INTO TABLE3 VALUES('1004');
INSERT INTO TABLE3 VALUES('1002');
INSERT INTO TABLE3 VALUES('1002');
INSERT INTO TABLE3 VALUES('1002');
INSERT INTO TABLE3 VALUES('1002');and you're queries not working...
SQL> Select count(*), count(distinct nodeid)
  2  from table1, table2,table3
  3  where table1.nodeid=table2.nodeid and table1.nodeid=table3.nodeid;
Select count(*), count(distinct nodeid)
ERROR at line 1:
ORA-00918: column ambiguously definedI'm guessing you want:
SQL> Select count(*), count(distinct table1.nodeid)
  2  from table1, table2,table3
  3  where table1.nodeid=table2.nodeid and table1.nodeid=table3.nodeid;
  COUNT(*) COUNT(DISTINCTTABLE1.NODEID)
        50                            2You haven't explained to us what database version you are using or what you want the output to look like when these 3 queries are combined.
Please read: {message:id=9360002} and learn to post a good question, and use {noformat}{noformat} tags to show your code/data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How can I make my query to compare only columns of two tables... not the storage information?

    11GR2
    =-----------------------------------
    I am using below querry to compare two table that has same name, under two different users... But after making storage information false like below and  if the storage information is different on column level than it create "Alter modify " statements for the column ... How can I make my query to compare only columns of two tables... not the storage information?
    begin
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY', TRUE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SEGMENT_ATTRIBUTES', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'STORAGE', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'TABLESPACE',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'REF_CONSTRAINTS',FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'CONSTRAINTS_AS_ALTER',FALSE);
    End;
    select REGEXP_REPLACE(dbms_metadata_diff.compare_alter('TABLE','TABLE_NAME_A','TABLE_NAME_A','USER1','USER2'),('USER1...'),'', 1, 0, 'i') from dual

    I am using below querry to compare two table that has same name, under two different users... But after making storage information false like below and  if the storage information is different on column level than it create "Alter modify " statements for the column ... How can I make my query to compare only columns of two tables... not the storage information?
    If you want help you have to SHOW us what you are doing and how you are doing it; you can't just try to tell us in your own words.
    We can't see your computer screen.

  • How can I make two copies of the same picture one with my watermark and one without for printing for clients?

    how can I make two copies of the same picture one with my watermark and one without for printing for clients?

    Export the photo twice, once with a watermark and once without a watermark.

  • How can I make a query by date with several TDMS files?

    Hi,
    I have a project that can write and read TDMS files everyday (a file for each day with date and time). There, I can import those files to excel (I choose a file and load it). But, I have a question: How can I make a query by date with those TDMS files? I'd like make a time stamp for start date and stop date, where I could compare the TDMS file dates and sum the values that are in the channels where these files are similar. For example, I save a file with "02/01/2013" name, in other day "03/01/2013", in other day "04/01/2013"... so, i'd like put in time stamp for start date "02/01/2013" file and to stop date "04/01/2013" file, than, sum all values that range with my TDMS files existing. How can I make that? 
    Thanks all,
    Val 

    Hello Val_Auto.
    You're Brazilian, no? Me too. = ^ - ^ =
    I converted VI to version of your LabVIEW (8.5). Is attached in this reply.
    This VI search all your TDMS in a range of dates and join them in a single TDMS. I hope this is what you wanted.
    Query TDMS is the main VI. The TDMS VI Search changes the date format that out from calendar control (which is DD / MM / YYYY) to DD-MM-YYYY. This is because you can't name files using "/". I chose "-" but, if necessary, you should change to keep the same format of your TDMS files.
    If you have any doubt as to its operation or how to make changes to adapt VI for your application, keep at your disposal.
    Thank you for your contact; I hope have helped you and succeed in your application.
    Wesley Rocha
    Application Engineer
    National Instruments Brazil
    Visite a nossa comunidade em PORTUGUÊS!!!
    Attachments:
    Query TDMS.vi ‏62 KB
    tdms search.vi ‏24 KB

  • HT204053 can i make two apple id using same credit card?

    can i make two apple id using same credit card?

    You can create an iTune and App Store account without credit card details
    1. Sign out of current Apple ID if you are sign-in to one (important)
    2. Go to App Store and select a free app
    3. Tap INSTALL APP
    4. Create New Apple ID
    5. Confirm Your Country
    6. Agree with Terms and Conditions
    7. Fill in your Apple ID and Password (you must create a new Apple ID; don't use your old Apple ID)
    8. Create and answer your secret question
    9. Select NONE for Payment Method
    10. Fill in Billing Address
    11. Submit application for new Apple ID
    12. Wait for verification email
    13. When email arrive, verify your account
    14. Start downloading your free apps

  • HT1719 Can more than one device access the same ITunes library?

    Can more than one device acess the same ITunes library?  And if so, does each device's list of songs remain separate and distinct for each device?

    No problems whatsoever. I have 3 iPhones and 3 iPod touches with different IOS connected.

  • How can you make one button preform different actions in Xcode?

    How can you make one button "preform a click" and "orderfront"? Is that possible? Because what I am doing is making a welcome window to my application for Mac OS X 10.6, and I have two buttons in that window, one says "Connect" which connects a a WebView to a url and the other button opens up the main window. So how can I a make a button do multiple things at once??

    Ah - If you are just using bindings between various objects from Interface Builder, you can reduce your application code a bit (sometimes quite a bit), but there is only so far you can go. Typically variables and routines are defined in your application that Interface Builder hooks into, so that your application code (usually Objective-C, but can be others) can use these variables and routines to determine what is happening in the user interface.
    I'm not sure how up-to-date the project code is (or what programming code you are familiar with), but you can take a look at Apple's Cocoa Application Tutorial to see what is (usually) involved in creating an application.

  • I have several issues that I hope you can help me out with. I am a professional photographer with a Mac with OS X 10.9.4: - I can only make ONE contact sheet in CS6 (from AUTOMATE) from pictures indicated in Bridge. If I want to make another contact sheet

    I have several issues that I hope you can help me out with. I am a professional photographer with a Mac with OS X 10.9.4:
    - I can only make ONE contact sheet in CS6 (from AUTOMATE) from pictures indicated in Bridge. If I want to make another contact sheet I need to shut down and restart CS6.
    - Camera RAW: if I change any setting in Camera RAW (except exposure), having first optimized the exposure, the exposure will automatically return to zero. Sometimes when I've set exposure and cropped the picture in Camera RAW Plug-In, the effects are lost just by opening the picture in CS6.
    - Sometimes if I crop a picture in Camera RAW, it may be impossible to open it again from Bridge!
    - I cannot do lens corrections in Camera RAW, at all. The Camera RAW comment is that "it cannot load the correct lens type". Why?

    Are you writing that when you select  a large number of images in the bridge  like a hundred thumbnails  when you then use Bridge menu Tools>Photoshop>Contact Sheet II that Photoshop only produces a single contact sheet for the first few thumbnails and fails to produce additional contact sheets for the other selected thumbnails? Photoshop contact sheet II script should create as many contact sheet as needed  for the numbers of thumbnails selected.  Perhaps the script is hung or you have exhausted  your machine resources.
    ACR Crop tool does not crop the RAW file it records crop settings to be used during the conversion process.    Camera RAW DATA is not altered.  The only changes made to RAW Files is ACR Metadata may be added.  Anything you do in ACR can be un-done in ACR.    If you can not open a RAW File in ACR the Files is either corrupt or from a new camera ACR does not support yet.  ACR should not corrupt RAW files.
    If you do not have a lens profile for ACR I think you should still be able to do lens correction manually in ACR.
    Some of what you write I don't follow could you post some screen captures of your problems often a picture helps.

  • Mountain Lion Recovery DVD - How can I make one, ML was installed on my iMac and BBP

    Mountain Lion Recovery DVD - How can I make one, ML was installed on my iMac and MBP when I purchased them. When I look at the App Store, it dose not show ML as purchased (to download again) - do I have to purchase it again to make a Recovery DVD?
    Thanks for your help.
    Regards
    NGI

    do i have to purchase it again to make a Recovery DVD?
    No. You can still make a bootable recovery DVD, but you will not be able to make a full bootable copy of ML without purchase.
    1) Enable the debug menu for Disk Utility via Terminal Application. Navigate to terminal by typing "terminal" in   spotlight. Copy the bolded text below and enter it into the command prompt:
    defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true ; open -a "Disk Utility" ; exit
    2) From the Debug Menu > Select Show every Partition > Recovery HD should appear
    3) Right click (control + click) the Recovery HD partition and select "Mount"
    4) Right click again the partition again > "Reveal Recovery HD in Finder". Leave this window open
    5) At this point, you will need open terminal again and enter the following command:
    sudo chflags nohidden /Volumes/Recovery\ HD/com.apple.recovery.boot/BaseSystem.dmg ; exit
         Type your password when prompted.
    6) Navigate back to the Recovery HD finder Window > com.apple.recovery.boot > BaseSystem.dmg
    7) Drag "BaseSystem.dmg" into Disk Utility's sidebar.
    8) Insert your DVD
    9) Select "BaseSystem.dmg" in the sidebar and hit "Burn"
    Once the burn is completed, hold option down at startup and select the DVD to boot. This is a bootable Recovery partition, not a bootable copy of ML.
    Note: to disable the debug menu,
    defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool false

  • TS5181 Can I make the playback volume the same for all the songs on a playlist?

    Can I make the palyback volume the same for all the songs on a playlist? Trying to maintain a constant volume without adjusting the volume for different songs.

    Hello PNCWood,
    It may help to enable Sound Check in iTunes' preferences.
    iTunes: About Sound Check
    http://support.apple.com/kb/HT2425
    Cheers,
    Allen

  • Can I make photo albums to get printed off like on iPhoto on the Mac? I only own an iPad.

    Can I make photo albums to get printed off like on iPhoto on the Mac? I only own an iPad.

    Photo books are only available in iPhoto on a Mac, not on the iPad.
    You can organize your photos into Journals on the iPad. If you have an iCloud account, you can publish your journal as a webpage and share a link to your journal with others. When you edit your journal, your changes automatically appear on your journal webpage.
    See: http://support.apple.com/kb/PH3152

  • How can I make one list of all events I have in over 30 libraries I made

    How can I make one list of all events I have in over 30 libraries I made?

    The only way I know of is to take a screenshot of the Photo mode with the View ➙ Show Event Titles selected.  That will give you a list of sorts.  Might take more than one screenshot per library.
                   Click to view full sized
    OT

  • How can we make one object as synchronizable?

    Hi!
    I am new to java.How can we make one object as synchronizable?
    Thanx

    Synchronize is used to make an object and/or a functional sequence thread safe. By itself it does not make something thread safe.
    So the point is to make something thread safe not just to synchronize it.
    You can either sychronize a method like so....
          public synchronized void doit()
    Or you synchronize on an object (where 'Object' below is solely as an example, any object can be used)...
          Object lockObject = new Object();
          public void doit()
             sychronized (lockObject)

  • Dear Gurus, Can i have SQL query to get Ar cash receipt appled lines details in R12

    Dear Gurus, Can i have SQL query to get Ar cash receipt appled lines details in R12

    I need to get ar and ap details from GL through xla.For ex: Reference1,reference2,reference3,reference4,reference 5, in 11i these column values are displayed in gl_je_lines where as in R12 we need to join xla tables with gl_sl_link_id and gl_sl_link_table
    Can someone provide query to get subledger details particularly ar and ap?.How are the AP & GL Journal Tables linked? [ID 1188714.1]
    R12 Mapping Between Subledger Tables, SLA and GL Tables [ID 871622.1]
    eTRM
    http://etrm.oracle.com/
    Thanks,
    Hussein

  • In imovie 09 can you make one continuous clip

    in imovie 09 can you make one continuous clip
    canu u download video in HDV to imovie 06 from a    SONY HDR-Fx 7 video camera as one clip

    No. iMovie 09 (and 11) is designed to import movies from camcorders. Every time it detects a start/stop it will make a different clip. They will be in chronlogical order, rather than edited order.
    If you still have iMovie 06, you can load the tape there as one continuous clip. Then EXPORT USING QUICKTIME choosing HDV as your codec. This will produce an MOV file that iMovie 09 or 11 can read, and which will be in the edited order.

Maybe you are looking for