Solved

Oracle EXISTS

Posted on 2011-03-18
2
238 Views
Last Modified: 2012-05-11
I have two tables

COMPANY
INTEROFFNOTE

Both tables have column names COMPANYACCNO

I need the output of those COMPANYACCNO which exists in BOTH COMPANY and INTEROFFNOTE
0
Comment
Question by:GRChandrashekar
  • 2
2 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
select companyaccno from company
intersect
select companyaccno from interoffnote
0
 
LVL 73

Expert Comment

by:sdstuber
Comment Utility
or try...


select companyaccno from company
where companyaccno in (
select companyaccno from interoffnote)


or ...


select companyaccno from company
where exists (select null  from interoffnote where company.companyaccno  = interoffnote.companyaccno )
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

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

6 Experts available now in Live!

Get 1:1 Help Now