Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-09-21 : 08:39:26
|
| Deepak writes "I have created two tables Employee_hours_1 and Employee_Hours_2 using one SQL Select query having the same criteria. Both the tables have same data but different counts. I would like to analyze the table with a query both the tables to find out which records are in one table and not in other? Employee_hours_1Name,Soc_sec, Hours, desc, CommentEmployee_hours_2Name,Soc_sec, Hours, desc, CommentThanksDeepak" |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2004-09-21 : 08:46:02
|
| one technique:select ... fromt1 left join t2 on t1.key1 = t2.key1 and t1.key2 = t2.key2 and ... where t2.xxx is nullyou might even use a full join to see wich records are in t1 but not t2 or in t2 but not in t1.rockmoose/* Chaos is the nature of things...Order is a lesser state of chaos */ |
 |
|
|
ffoiii
Starting Member
12 Posts |
Posted - 2004-09-22 : 00:09:25
|
| select t1.*, t2.*from t1 full outer join t2 on t1.key1 = t2.key1 and...where t1.key1 is null or t2.key1 is nullffoiii |
 |
|
|
|
|
|