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 |
krista80
Starting Member
29 Posts |
Posted - 2011-01-31 : 09:45:45
|
Hi. I want to delete rows from one table that match rows in another table. How do I do this? My current query syntax looks like this:DELETE FROM table2WHERE EXISTS(SELECT * FROM Results as r, Information as iWHEREr.firstColumn = i.firstColumnAND r.secondColumn = i.SecondColumn)Any help? |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-01-31 : 09:48:26
|
Please give table structure, example data and wanted result. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
krista80
Starting Member
29 Posts |
Posted - 2011-01-31 : 10:00:21
|
I have two tables, both with two columns that just have 3 numbers in each. I have loaded both tables with 5 rows of information. 3 rows have different information in each table, and two rows have the same information. I want to delete the 2 rows of matching information. All columns are set to varchar(MAX) and they don't allow nulls. |
 |
|
krista80
Starting Member
29 Posts |
Posted - 2011-01-31 : 10:22:12
|
I figured it out. Sorry for any inconvenience. |
 |
|
|
|
|