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 2012 Forums
 Transact-SQL (2012)
 Delete Statement

Author  Topic 

yguyon
Starting Member

11 Posts

Posted - 2015-02-10 : 16:05:15
I would like to write a delete statement that delete some row based from this querry ...

SELECT EcommTransID, EcommAuthCode, EcommLast4, EcommAmount, EcommCurrency, EcommSource, EcommNumInv, EcommNumPO, EcommCardType, EcommTransDate, EcommSettleDate
FROM dbo.Acct_EcommSiteTransactionStaging

--EXCEPT
INTERSECT

SELECT EcommTransID, EcommAuthCode, EcommLast4, EcommAmount, EcommCurrency, EcommSource, EcommNumInv, EcommNumPO, EcommCardType, EcommTransDate, EcommSettleDate
FROM dbo.Acct_EcommSiteTransaction

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-10 : 16:11:16
DELETE FROM table
JOIN (

... your original query

) q
on q.EcommTransID = table.EcommTransID
and q.EcommAuthCode = table.EcommAuthCode
and ...
Go to Top of Page
   

- Advertisement -