473,804 Members | 3,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MINUS operator - How it works.!!??

Hi,
Could someone please tell how MINUS operator works for comparing and
giving non-matching records in Table1? Does MINUS operator compares
all records of Table1 with all records of Table2 to give differences?
Say, i've got 2 tables - no keys defined on them. No PK and UK. Now
MINUS operator will pick which columns for comparison? Having a PK/UK,
i see it as comparing these keys and susequently the rest of fields
for matcing key records, thereby reporting non-matching records from
Table1. Say, if both Table1 and Table2 have 300,00 records each. Now
how many comparisons would this result in?

Someone please light a bulb on me... or direct me to some good links
that would clear my doubts on this.

TIA
Jul 19 '05 #1
2 13853
Newbie wrote:
Hi,
Could someone please tell how MINUS operator works for comparing and
giving non-matching records in Table1? Does MINUS operator compares
all records of Table1 with all records of Table2 to give differences?
Say, i've got 2 tables - no keys defined on them. No PK and UK. Now
MINUS operator will pick which columns for comparison? Having a PK/UK,
i see it as comparing these keys and susequently the rest of fields
for matcing key records, thereby reporting non-matching records from
Table1. Say, if both Table1 and Table2 have 300,00 records each. Now
how many comparisons would this result in?

Someone please light a bulb on me... or direct me to some good links
that would clear my doubts on this.


The answer is documented at http://tahiti.oracle.com
go RTFM for enlightenment

Jul 19 '05 #2
"Anna C. Dent" <an******@hotma il.com> wrote in message news:<sOeub.237 02$Q64.11116@fe d1read03>...
Newbie wrote:
Hi,
Could someone please tell how MINUS operator works for comparing and
giving non-matching records in Table1? Does MINUS operator compares
all records of Table1 with all records of Table2 to give differences?
Say, i've got 2 tables - no keys defined on them. No PK and UK. Now
MINUS operator will pick which columns for comparison? Having a PK/UK,
i see it as comparing these keys and susequently the rest of fields
for matcing key records, thereby reporting non-matching records from
Table1. Say, if both Table1 and Table2 have 300,00 records each. Now
how many comparisons would this result in?

Someone please light a bulb on me... or direct me to some good links
that would clear my doubts on this.


The answer is documented at http://tahiti.oracle.com
go RTFM for enlightenment


I looked at the documentation related to minus and did not find the
organization that useful in light that I believe the question is
directed at determining how Oracle actually goes about solving a minus
operation rather than what minus produces or how to use the minus
operator. As such I do not think the answer is in the documentation
though the documentation should clear up some of newbie's confusion
related to his or her comments on PK.

Newbie, Logically when you use the minus operator you are asking for
all the rows in A that are not in B. This can be thought of as an
outer join of B to A so that all the rows in A are returned but you
discard the matching rows leaving only the rows in A that have no
match in B. I believe this is called an anti-join. The match is
performed on all columns in the select list so the presence or absense
of keys do not matter; duplicates are eliminated.

How Oracle goes about solving the query internally is not our concern
in that Orcle could potentially change the internal methods employed
at any time. You can run explain plan and trace files to see what
Oracle is doing for a specific query.

HTH -- Mark D Powell --
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3231
by: Joe | last post by:
Hello, Hopefully you sql guru's can help me out a bit. :) Here is the short example of what I want to accomplish. I wish to have the difference between two different select queries. So if one query pulls records 1,2,3 and 4 and the second pulls records 1 and 4 I wish to have only the records 2 and 3. How can I accomplish this easily.
2
1189
by: Frederic Rentsch | last post by:
Hi all, I have a class Time_Series derived from list. It lists days and contains a dictionary of various Lists also derived from list which contain values related to said days. (e.g. Stock quotes, volumes traded, etc.) I defined an operator += which works just fine, but only once. If I repeat the operation, it fails and leaves me utterly mystified and crushed. Craving to be uncrushed by a superior intelligence.
6
2592
by: Matthew Cook | last post by:
I would like to overload the unary minus operator so that I can negate an instance of a class and pass that instance to a function without creating an explicit temporary variable. Here is an example: #include <iostream> using namespace std; class Object { public:
1
4374
by: mymurali24 | last post by:
i need synat for minus operator in my sql
6
4700
by: Nelsupremo | last post by:
I am not fluent in overloading stuff .. there was a question that I can across on net .. any bright ideas? The program will contain a class Matrix, This class will contain a private data member Array which store int values. The class will further contain a Default constructor, get() function which takes values for array from the user and also contain a Display function witch display the array on the screen, In main function create three...
2
7653
by: CenturionX | last post by:
Hello everybody i'm trying to use the minus operator like that: (SELECT DISTINCT TRIM(S.Lname & ', ' & Fname) AS Name, S.SID FROM Salesperson as S, Schedule as H WHERE S.SID = H.SID AND H.Day = 4 AND H.AM = 0 AND H.PM = 0 AND H.Ev = 0) MINUS
2
10011
by: Shalini Bhalla | last post by:
I want to extract records form a table . I have Table A and Table B . I want to extract unmatching records from table A to table B .... Can you Please tell me how to extrat it ? How to make use of minus in access
2
411
by: Newbie | last post by:
Hi, Could someone please tell how MINUS operator works for comparing and giving non-matching records in Table1? Does MINUS operator compares all records of Table1 with all records of Table2 to give differences? Say, i've got 2 tables - no keys defined on them. No PK and UK. Now MINUS operator will pick which columns for comparison? Having a PK/UK, i see it as comparing these keys and susequently the rest of fields for matcing key records,...
2
1251
by: avixt | last post by:
//like this. please answer..... int main() { float num = 4.2; printf(" %f\n",(num << 1)); }
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.