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 |
divan
Posting Yak Master
153 Posts |
Posted - 2013-06-24 : 10:56:51
|
I have a table TAIL with the following recordspolicy_number premcc 10063 1000cc 10063 10050cc 10063 10034cc 10063 1005I have another table DETAILPOLICY PREMCC 10063 1000CC 10063 10050CC 10063 10034CC 10063 1005CC 10063 100500I need a script that will show me the records that are in DETAIL but not in TAILPlease helpThanks |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2013-06-24 : 11:02:21
|
SELECT A.Policy_number,B.Policy_numberFROM Detail ALeft Join Tail B on A.policy_number=B.Policy_Number --Considering that its the Policy_Number through which the tables are joinedWHERE B.Policy_Number IS NULLCheersMIK |
|
|
mmkrishna1919
Yak Posting Veteran
95 Posts |
Posted - 2013-06-24 : 11:31:05
|
Hi Divan,If your are trying to compare all columns of both tables then then try this?Records that are in detail not there in tail..select policy_num,perm from detailexceptselect policy_num,perm from tailRecords that are in tail not there in detail..select policy_num,perm from tailexceptselect policy_num,perm from detailthanks..M.MURALI kRISHNA |
|
|
|
|
|