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!

Need help in SQL query to get only distinct records

515228Feb 2 2011 — edited Feb 2 2011
Hi all.
I am new to oracle SQL and i want to write a query to get only distinct values from 2 tables.
for example i hade 2 tables table1(employee_id,employee_no,grade) and another table2 with same structure.
for example data in table1 is

Employeeid employeeno Grade
1 101 A
1 101 B
1 101 E
1 101 D

and data in table 2 is

Employeeid employeeno Grade
1 101 A
1 101 B
1 101 E


i want to display only the fourth row like the data that doesnt exist in table2 i,e (1 101 D)

I had too much records in both tables and i jst want to see the records that is in table 1 not in table 2 only.
employeeid and employeeno are the same in both tables

I hope u understand my query. I user left outer join and right outer join bt it displays all the results that and matching and unmatching. I want jst unmatched records.

Any help is highly Appreciated.
Thanx in Advance.
I am using oracle 10G on windows
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2011
Added on Feb 2 2011
7 comments
374 views