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
 Transact-SQL (2000)
 Delete from JOIN query

Author  Topic 

shohelic
Starting Member

6 Posts

Posted - 2007-01-23 : 02:25:53
Hello friends,

If I want to delete the result of a JOIN query then how I shell do it.

I have two table with same column and same structure, table1, table2 and have same identity column. Two tables contains some common and different data. Now I need to delete those rows from [table1], which are matched in 2 identity column with the [table2].

If I could make it clear, then please help me.

-Shohel

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-23 : 02:34:05
delete t1
from table1 as t1
inner join table2 as t2 on t2.identitycol = t1.identitycol


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

shohelic
Starting Member

6 Posts

Posted - 2007-01-23 : 03:04:02
Dear Peter

Thank you very much. Its working..

-Shohel
Go to Top of Page
   

- Advertisement -