Solved

Oracle EXISTS

Posted on 2011-03-18
2
241 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 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 35170391
select companyaccno from company
intersect
select companyaccno from interoffnote
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 35170393
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.

Question has a verified solution.

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

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…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

830 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