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


Both tables have column names COMPANYACCNO

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

Accepted Solution

sdstuber earned 500 total points
ID: 35170391
select companyaccno from company
select companyaccno from interoffnote
LVL 73

Expert Comment

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 )

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

Suggested Solutions

Title # Comments Views Activity
File generation using utl_file 4 53
Oracle SQL syntax check  without executing 6 50
Oracle sql query 7 60
upgrading Oracle 10g/ 11g / 11g R2 to Oracle 12c 25 54
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

786 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