Solved

SQL question

Posted on 2014-11-11
3
177 Views
Last Modified: 2014-11-11
I have SQL question I would like some help with.
0
Comment
Question by:mdoland
  • 2
3 Comments
 

Author Comment

by:mdoland
Comment Utility
Whoops, I missed the question...

I have to tables X and Y. See below.
X with columns A1 and A2.
Y with columns A1 and A3.

I want to have all elements from A1 in table X where there are no corresponding element A1 in Y.
Did that make sense?
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
select a1 from x
where a1 not in (select a1 from y)


or

select a1 from x
where not exists (select 1 from y where y.a1 = x.a1)


or

select a1 from x
minus
select a2 from y

Note, the minus version will implicitly return distinct values, that may or may not be what you want.
0
 

Author Comment

by:mdoland
Comment Utility
Perfect!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now