|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Delete Question
Hi everybody,
I want to delete records from one table that meet certain criteria from more than one table. Something like Delete from table_1 where field.table_1 =.... and field.table_2 = .... I'm afraid to have "from table_1, table_2" because I don't want to delete anything from table 2, only table 1. I was successfully able to select all the data I wanted to delete, now I just need to delete them. Is there I way I can modify that successful SELECT table by inserting a line or two? Thank you so much for your help. |
|
#2
|
||||
|
||||
|
Something like this:
Code:
DELETE FROM t1 FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.field1 = t2.field2 AND t1.field3 = ...
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Delete Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|