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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Data Difference

Author  Topic 

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2008-12-06 : 04:44:56
Hi M with an Another problem....
I want the Data Difference between two tables as i have two tables Like....

Tbl_A

Slab_Id Cust_Id
1 457745
4 47846
7 145797


Tbl_B

slab_id cust_id voch_entry

....Some Data



so i like to take differnce between the data ....in both tables...
as tbl_B have not all the values in tbl_A

The key fields for data is Slab_id and cust_id......

i use that query for that purpose but its too slow on the data of more then 4 lacs record......

i post that query..please optimize that query for me...

Select slab_id,cust_id
FROM Tbl_A
WHERE NOT EXISTS
(SELECT 1 FROM tbl_B
WHERE Tbl_A.slab_ID = tbl_B.slab_ID
AND Tbl_A.cust_id = tbl_B.cust_id
)

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-06 : 09:32:11
Why Duplicate?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=115789
Go to Top of Page
   

- Advertisement -