Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

MINUS IN SQL PLUS

536922Apr 7 2010 — edited Apr 8 2010
Hi I have this query and it returns 4 records one of those is a duplicate

SQL> col adjustment_reason format a30
SQL> SELECT account_no ,descr as adjustment_reason,
2 gl_id,amount as adjustmentamount
3 FROM src_misc_adj_rpt;

ACCOUNT_NO ADJUSTMENT_REASON GL_ID ADJUSTMENTAMOUNT
------------ ------------------------------ ---------- ----------------
1-36795186 Acct Transfer Adjust-System 135 -37.61
1-36795186 Acct Transfer Adjust-System 135 59.24
1-36795186 Acct Transfer Adjust-System 135 -36.78
1-36795186 Acct Transfer Adjust-System 135 -36.78

and another query

SQL> SELECT account_no ,descr as adjustment_reason,
2 gl_id,amount as adjustmentamount
3 FROM tgt_misc_adj_rpt;

no rows selected

I get no results

I am doing a minus on these

SQL> SELECT account_no ,descr as adjustment_reason,
2 gl_id,amount as adjustmentamount
3 FROM src_misc_adj_rpt
4 MINUS
5 SELECT account_no ,descr as adjustment_reason,
6 gl_id, amount as adjustmentamount
7 FROM tgt_misc_adj_rpt;

ACCOUNT_NO ADJUSTMENT_REASON GL_ID ADJUSTMENTAMOUNT
------------ ------------------------------ ---------- ----------------
1-36795186 Acct Transfer Adjust-System 135 -37.61
1-36795186 Acct Transfer Adjust-System 135 -36.78
1-36795186 Acct Transfer Adjust-System 135 59.24


I get only 3 records . I want to get all the 4 records even the duplicate record. Is there any other way to do that
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2010
Added on Apr 7 2010
9 comments
3,260 views