Find the schema which contains all these tables

In my DB, only SCOTT has all the three tables EMP,DEPT, BONUS. There are schemas which have either one or two of these tables but only SCOTT has all these 3 tables.
To find the schema which contains all these *3* tables. I tried the below mentioned queries which gave the wrong answers.
1.
select TABLE_NAME, owner from dba_Tables where table_name IN ('EMP','DEPT', 'BONUS')-- will return any schema which has any of these tables. So, wrong result
2.
select TABLE_NAME, owner from dba_Tables where table_name = 'EMP' AND TABLE_NAME='DEPT' AND TABLE_NAME= 'BONUS'-- Wrong result because it is mutually contradictory. As AP has mentioned below, A table_name cannot be equal to all the three tables .
Edited by: GarryB on Dec 22, 2010 7:56 AM

Hi,
GarryB wrote:
Thanks everyone. So, this means that this seemingly simple query cannot be written with just a plain AND , OR . Right?You're right. Every query needs SELECT and FROM, for example.
What's wrong with Solomon's simple solution?
Whatever you don't like about it, I'm sure there's another approach that doesn't have the same problem, even if it is slower and more complicated.
As AP pointed out, no one row has all the information you need to decide if that row will be part of the result set or not.
You need something that can make a decision based on the data in multiple rows.
GROUP BY, like Solomon suggested, is the easiest and most efficient way I know of.
Anything that GROUP BY does can probably be done by analytic functions. In this case, it will be more complicated and slower, but you can get the same results.
A self-join, as user13524665 demonstrated, is another way.
You could also get the results you want using EXISTS-, IN-, or scalar sub-queries, all of which would be even more complicated, and scale just as poorly, as a self-join.
CONNECT BY, recursive sub-queries, MODEL, and XML functions can also look at several rows at the same time. I don't believe you want to read and test soltuions for all of these any more than I want to write all of them. Solomon gave a good solution for your original problem. If you want to add some extra restrictions to your problem (such as "I can't use ... or ...") explain clearly what those restrictions are, and why you need them.

Similar Messages

  • Where do i find the folder which contains all my emails please?

    thank you

    Why are you looking for it? Note that you *should not* mess with those files unless you know what you're doing, and having to ask where the folder is means you probably don't know what you're doing (at least, when it comes to Mail files). If you have a problem you're trying to solve, you'd be better off to post that question than to start poking around.
    That said, look in ~/Library/Mail/ for all your mailboxes and other Mail-related files. (The '~' means "your user folder".)

  • Export dump only 1000 tables from the schema which contains 3000 tables.

    Hi,
    I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
    As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
    Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.
    Thanks in advance.
    Thanks,
    Orahar.

    I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
    As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
    Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.You haven't mentioned the oracle release version.
    if you're using 10g, you could use datapump export/import to achieve this. Not a straight way.
    Check Metalink Export/Import DataPump Parameters INCLUDE and EXCLUDE - How to Load and Unload Specific Objects - 341733.1
    Under section 9. Exporting or Importing a large number of objects.
    HTH
    -Anantha

  • Is there any standard report which contain all these fields

    is there any standard report which contain all these fields
    1. plant
    2. material no.
    3. profit  center
    4. movement type
    5.g l a/c
    6.posting date
    we have it in z form one of the job it does is that what all materials entries came to a single gl we can know from it
    like we can know what all materials were charged to repair to p and m a/c.
    can any one tell where can we find these field in any standard format in sap.
    pls send some suggestions.

    Hello Sanjeev,
    I don't think there is an existing standard report with all the information from KE5Z plus material name.
    What I would suggest to you is either:
    1) Copy the standard KE5Z program (RCOPCA02) to a Z program one and insert the additional field from MAKT table (it would demand ABAP coding and some considerable effort to develop it);
    2) Create a Query (SQ01 transaction) by selecting data from GLPCA (table that is used in KE5Z) and MAKT (table that contains the material name by language).
    Hope it helps you.
    Best Regards,
    Daniel.

  • How can I find the schemas used in a database?  Any system table contains?

    How can I find the schemas used in a database? 
    Any system table contains?
    I would like to know sql statement (dictionary object name) which tells the all schema s in a database like dba_users.

    Hello,
    this SQL should help:
    db2 "select schemaname from syscat.schemata"

  • How to create a folder (in unified folders) which contains all the messages of inboxes and outboxes

    Hi, i've searched without success how to create a folder (in unified folders) which contains all the messages of inboxes and outboxes (as it exists in Windows Live Mail).
    For me, it would be very useful to search in only one folder when i try to find something in sent and received mails.
    Thank's

    This is what Unified Folders does. I'm not sure what exactly you're trying to achieve.
    http://kb.mozillazine.org/Global_Inbox#Unified_Folders
    You might take a look at this article.
    https://support.mozilla.org/en-US/kb/global-search

  • ARE THERE ANY WAYS BY WHICH I CAN FIND THE Appln Servlet Container Memory

    ARE THERE ANY WAYS BY WHICH I CAN FIND THE Appln Servlet Container Memory .

    You can check out Tomcat memory usage using Tomcat Manger
    and clicking server status.
    It gives the information like this
    Free memory: 489.80 MB Total memory: 508.12 MB Max memory: 1016.12 MB
    For specific application stats, i think there are some profilers which u have to search in google.

  • Where or how do I find the installation package containing "iTunes.msi"?

    I have iTunes 10.5.3.3 installed on my computer with a Windows XP operating system.  I have tried to download the new itunes 10.6 but continually get a pop up which states "The feature you are trying to use is on a network resource that is currently unavailable.  Enter an alternate path to a folder containing the installation package "iTunes.msi".  I have tried  and failed to find this package. 
    I have also tried the support page suggestion by uninstalling the old itunes and then install the new one.  This did not work.  Another pop up also tells me that I cannot remove the old (10.5.3.3) itunes...because..." the feature I am trying to use is on a network resource that is currently unavailable". I am caught in a loop.  It appears that I need to locate the "iTunes.msi" installation package in order to be able to uninstall the old and replace with the new iTunes upgrade.
    Where or how do I find the installation package containing "iTunes.msi"?  Secondly, when I find it is there anything special I need to do or be aware of?

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Where can I find the schema for config.xml file of jax-rpc

    For the xrpcc tool I need to create a config.xml file, does any body know where can I find the schema for it?

    http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXRPCxrpcc.html and all your questions will be answered... except maybe why aren't these pages linked from the main index anymore? (they were when 1.0 of the tutorial was released, but then there were no docs for wscompile or wsdeploy. The JAX-RPC release notes fixed the latter, but around 1.0_01 they broke the former.)

  • How can I find the procedures where I use a table?

    How can I find the procedures where I use a table?
    I need to look for it in all the users.

    select name,owner from dba_dependencies where referenced_name='table_name'
    and referenced_owner = 'schema'
    and type = 'PROCEDURE'
    Aravind

  • How to find the records using contains with the word like this 'some text-some text'?

    Hi,
    How to find the records using the full text contains keyword and that column contains ‘some text-some text’
    In the above some text can be anything.
    Does anybody know please let me know.
    Thanks,

    Hello,
    You can try to create a Full Text Index on the table and use CONTAINS() to get the record which contains the specify words.
    For example:
    SELECT * FROM TABLE WHERE CONTAINS(column_name, 'some text')
    Reference:
    Full-Text Search (SQL Server)
    Creating Full Text Catalog and Full Text Search
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • What is the purpose or functions of these tables?

    Dear Experts,
    Briefly, could you explain what is the purpose or function of these tables:
    1. INOB - link between internal number and object. Is internal number = internal order number? related to project? purpose?
    2. AUSP -  Characteristic values - what characteristics? all? purpose?
    3. CABN - Characteristic : what is the purpose of this table?
    4. KLAH - Class header data : what is purpose of Class ?
    Are these cross-application like MM+SD etc or application area-specific eg MM only?
    Sorry, but i have no strong functional knowledge in these aspects. Please enlighten me.
    Thanks in advance.
    regards
    Bass

    1. INOB - link between internal number and object. Is internal number = internal order number? related to project? purpose?
    It is a linking table for internal number and object for characterstics tables.It is not relate to project.
    2. AUSP - Characteristic values - what characteristics? all? purpose?
    It will show what are the objects in class and internal characterstics.Details it will not show and it shows only numbers
    For e.gSuppose you have provided some values in Characterstics like qty 10,20..and colour ...red ,while..,Sytem will show these details in this table.
    3. CABN - Characteristic : what is the purpose of this table?
    It will show the type of characterstic is this numeric or  character
    4. KLAH - Class header data : what is purpose of Class ?
    This is also linking table.Thease are cross application tables MM+SD +PP as charactersics used in all process.

  • Find the tech names of all query's present in a workbook

    Hi,
    I need some materials  on workbooks.
    How find the tech names of all query's present in a workbook. I had an issue from end user and they just send me the workbook. So now i need to find out all the querries present in workbook.
    Please let me know steps to find out and some materials on workbook.
    Thanks,

    Hi
    Check in metedata repositroy.., when you click on th query here, it will show you which infoprovider it is created and list of workibooks created on the query etc.....
    Hope it helps you.... else get back
    Regards
    Rajesh

  • How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available? Kindly help

    How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available?
    kindly suggest a solution.
    Thank you inadvance!

    You can only import photos/videos via USB and the camera connection kit.
    ITunes: Syncing media content to your iOS devices
    http://support.apple.com/kb/ht1351
     Cheers, Tom

  • How do I find the total size of all my Music in iTunes 11?

    I'm looking to get a new iPod, either a nano or Touch, so I'm trying to find the total size of all of my Music. Since iTunes 11's interface is so different from previous versions, I don't see a way to view that.

    Ctrl B to show top menu
    View Show Status Bar to show the grey bar at the bottom with the info you want.
    While your there View> Show Sidebar and see if you prefer that.

Maybe you are looking for