Home » SQL & PL/SQL » SQL & PL/SQL » help in simple sql statement
help in simple sql statement [message #19326] Tue, 12 March 2002 01:49 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
The first query returns me 769 records
and the second part of query returns me 765 records

but when i use minus,why there is no result at all.

select imp.idbrand,imp.dsnmbrand from timp_tkeybrand imp,tkeybrand t where
trim(upper(imp.dsnmbrand)) = trim(upper(t.dsnmbrand))

minus

select imp.idbrand,imp.dsnmbrand from timp_tkeybrand imp,tkeybrand t where
trim(upper(imp.dsnmbrand)) = trim(upper(t.dsnmbrand))
and imp.idbrand = t.idbrand
Re: help in simple sql statement [message #19328 is a reply to message #19326] Tue, 12 March 2002 04:04 Go to previous message
Jon
Messages: 483
Registered: May 2001
Senior Member
My guess is you have duplicates as in the following:

09:02:31 ==> select col1 from table1;

COL1
---------
1
1
1
2

4 rows selected.

09:02:42 ==> select col1 from table2;

COL1
---------
1
2

2 rows selected.

09:02:51 ==> select col1 from table1 minus select col1 from table2;

no rows selected

09:03:06 ==>
Previous Topic: range search
Next Topic: Passing a VB ADO 2.6 recordset to PL/SQL
Goto Forum:
  


Current Time: Sat Apr 20 08:46:32 CDT 2024