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 |
|
zubair
Yak Posting Veteran
67 Posts |
Posted - 2004-05-10 : 06:54:50
|
| I have a select statement that return me the id column of files to delete like soselect [file].fileIdfrom [file] inner joinfileType on [file].fileTypeId = fileType.fileTypeIdwhere [file].assetId = '292332E5-C042-4020-AA8D-A036294D19D7'and fileType.resolution = 'high'this shoudl return me say 2 fileid values which are uniqueidentifiers232312FA-2650-47C8-9F28-73AE3B203244FFE6236B-663F-4A91-A693-6DBCD24E7520I then want to do a delete from the [file]. table where these values exist?This looks simple to do but I'm stuck on doing a delete where there is more than one value to do a delete on |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-05-10 : 07:07:18
|
| [code]delete from [file] where fileid in (select [file].fileIdfrom [file] inner joinfileType on [file].fileTypeId = fileType.fileTypeIdwhere [file].assetId = '292332E5-C042-4020-AA8D-A036294D19D7'and fileType.resolution = 'high')[/code] |
 |
|
|
zubair
Yak Posting Veteran
67 Posts |
Posted - 2004-05-10 : 07:12:53
|
| thanks! this works |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-05-10 : 07:32:24
|
Of course it does... |
 |
|
|
|
|
|