help in simple sql statement [message #19326] |
Tue, 12 March 2002 01:49 |
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 |
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 ==>
|
|
|