Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need a sql query 1

Status
Not open for further replies.

PeriyurParthi

IS-IT--Management
Jul 18, 2001
258
IN
hi all
i have 2 transaction table... code is a common field for both the tables, what i need is a sql query to compare and list out the codes which are not present at the both the tables, replies will be help ful
cheers
parthi
 

Supose you have two tables :firsttable and secondtable with a common field named code.
You can try this:

select code from firsttable where code not in (select code from secondtable) union select code from secondtable where code not in (select code from firsttable)

You will obtain an cursor with code which are not in the both tables (or you can create a new table).
With this cursor or table you can create a report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top