Jayce Ooi’s Paradise

Photography, gaming, programming, technology, finance, anything

Hmm… I have been using SQL for quite some time. But I do not know how to compare 2 tables to find out the different records. For example, I have 2 tables which are table A and table B. Both of them have some similar records. But I want to filter out the different data only. How can I do so? I searched online and discovered the method to do so. It is located in Microsoft SQL Server 2005 Books Online. All we need to do is use EXCEPT function in SQL.

Query to compare 2 tables to find the different

SELECT * FROM TableA EXCEPT SELECT * FROM TableB;

Query to compare 2 tables to find the matches

SELECT * FROM TableA INTERSECT SELECT * FROM TableB;

Hope this will help you too. ;)

Let’s play PROLiNK Match & Win game

Oh, before you play. This is the match and win game from PROLiNK online contest. Too bad that the contest ended. However, you still play the game here (I copied from waahhh.com website). You can also play over there, but registration is required. :P

(more…)



Hot Topic

HTC HD2 Dell UltraSharp U2410 Review