minus operator [message #21735] |
Tue, 27 August 2002 00:50  |
Raj
Messages: 411 Registered: November 1998
|
Senior Member |
|
|
hi,
if i use minus operator i want the duplicate records also to be displayed.
for example
in table t1 (id number)
id
1
2
1
in table t2 (id number)
id
3
if i give the following query
select id from t1
minus
select id from t2
output :
1
2
3
i want the output to be displayed as
1
1
2
3
thanks and regards,
raj
|
|
|
Re: minus operator [message #21736 is a reply to message #21735] |
Tue, 27 August 2002 01:19   |
Raj
Messages: 411 Registered: November 1998
|
Senior Member |
|
|
hi,
if i use minus operator i want the duplicate records also to be displayed.
for example
in table t1 (id number)
id
1
2
1
in table t2 (id number)
id
3
if i give the following query
select id from t1
minus
select id from t2
output :
1
2
i want the output to be displayed as
1
1
2
3
thanks and regards,
raj
|
|
|
|
Re: minus operator [message #21744 is a reply to message #21735] |
Tue, 27 August 2002 08:22   |
UmsSund
Messages: 1 Registered: August 2002
|
Junior Member |
|
|
Raj
Union all will do the trick as Victoria suggested....
select id from t1
union all
select id from t2
Thanks
-UmaSund
|
|
|
Re: minus operator [message #21750 is a reply to message #21735] |
Tue, 27 August 2002 20:41  |
Raj
Messages: 411 Registered: November 1998
|
Senior Member |
|
|
hi,
thanks for the reply.but if i use union all it w'll select all the records from both the tables.i want all the records from first table which is not in second table.so, i have to use minus operator.but, it is selecting the distinct records.
bye,
raj
|
|
|