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 |
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2009-12-15 : 02:19:41
|
| how can I form a delete statement form this select statement-----------------------------1.select * from SAP_ORDER_COST LEFT JOIN KC_SAP_ORDER ON SAP_ORDER_COST.SAP_ORDER_COST_ORDER_NUMBE_ = SAP_ORDER.SAP_ORDER_ORDER_NUMBE_CHRWhere SAP_ORDER_COST.SAP_ORDER_COST_ORDER_NUMBE_ <> SAP_ORDER.SAP_ORDER_ORDER_NUMBE_CHR2.Declare @LastRunDate as Dateimeset @LastRunDate='31-Dec-2008'select * from SAP_NOTIFICATION LEFT JOIN SAP_ORDER ON SAP_NOTIFICATION.SAP_NOTIFICATION_ORDER_NUMB = SAP_ORDER.SAP_ORDER_ORDER_NUMBE_CHRWhere (SAP_NOTIFICATION.SAP_NOTIFICATION_ORDER_NUMB IS NOT NULL AND SAP_ORDER.SAP_ORDER_ORDER_NUMBE_CHR IS NULL)OR (SAP_NOTIFICATION.SAP_NOTIFICATION_COMPL_DATE <= @LastRunDate AND SAP_NOTIFICATION.SAP_NOTIFICATION_ORDER_NUMB IS NULL) |
|
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
Posted - 2009-12-15 : 05:37:31
|
Use... delete TABLE_NAME ...rather than... select * Ryan Randall - Yak of all tradesSolutions are easy. Understanding the problem, now, that's the hard part. |
 |
|
|
|
|
|