Hi Guys This is what i am trying to do...I have 1 table calledd...User_LOGIN and it has 2 column...one it LOGON1 and LOGON2...i want to compare these two column and find out which record is missing and produce txt file with the missing one... I have one record which has all the records from column 1 and another record set with all the records from column 2... now i am struggling as to how do i compare these two record set... Could you give me some example...as how should i do this... I do appreciate ur time and consideration... Regards, Rashmi
Rashmi, I don't think this post is anything to do with Servlets, rather it is SQL. I am not entirely sure, what you are trying to achieve but if its to compare two tables and find out what is missing in one, you can do the following (I am using MySQL): SELECT t1.col1, t1.col2 FROM table1 t1 LEFT JOIN table2 t2 ON t1.col1 = t2.col1 WHERE t2.col1 IS NULL; HTH
The secret to creativity is knowing how to hide your sources.
I think you said you were comparing record sets - the results of two queries. The basic algorithm for this goes back to the ancient geeks of mainframe batch days:
End of file (set) can be handled a couple ways. One is to set an impossibly high key so the key comparisions keep working. Another is to add EOF tests to the comparisons: if A Key < B Key or B EOF ... I wrote a little program that does this logic on any two result sets. You tell it how many columns are involved in the key and make sure those columns are left-most in each row. Pretty cool to compare data or meta-data between two versions of a database. Was that what you were asking?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi