?
Solved

query

Posted on 2014-04-11
6
Medium Priority
?
239 Views
Last Modified: 2014-06-10
How can I create a query..
The output of select * from dba_users should not have the given list of users sch1,sch2,sch3

ie, if the database has sch1,sch2,sch3 list out.. that
0
Comment
Question by:tonydba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 49

Assisted Solution

by:PortletPaul
PortletPaul earned 1000 total points
ID: 39995391
I really don't understand your question.

do you want ONLY sch1,sch2,sch3

select * from dba_users where username in ('sch1','sch2','sch3')


or do you want everything EXCEPT sch1,sch2,sch3

select * from dba_users where username NOT in ('sch1','sch2','sch3')
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 39995404
If you have list of owner in separate table, then you can also use

select * from dba_users where username IN (select username from another_table);

You can use NOT IN as well as required.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1000 total points
ID: 39995490
One minor correction to the first post.  Oracle translates object names to upper case unless you force them to case sensitive, NOT recommended, by using double quotes.

Change:
select * from dba_users where username NOT in ('sch1','sch2','sch3');

to:
select * from dba_users where username NOT in ('SCH1','SSH2','SCH3');
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 39995995
What is your expected output?
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 40124047
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to recover a database from a user managed backup

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question