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 |
Girlnet
Yak Posting Veteran
77 Posts |
Posted - 2007-11-15 : 15:00:34
|
Someone please help the goober! I usually have a way of making queries more complex than needed, but I just can't get my head around this. Here's the table:CREATE TABLE [dbo].[QAD_ManuSchedule] ( [wo_lot] [int] NOT NULL , [code_fldname] [char] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , ) ON [PRIMARY]In this table there could be rows like this:wo_lot code_fldname123 multiout123 null1234 null123 nullI need to find all the wo_lot with code_fldname='multiout', then delete all occurances of the wo_lot associated with it. So, when done, the only record left would be:1234 nullGod! I hate being stuck! Thanks for any help! |
|
JustaHustla
Starting Member
5 Posts |
Posted - 2007-11-15 : 15:14:05
|
Try this:delete from QAD_ManuSchedulewhere wo_lot in (select wo_lot from QAD_ManuSchedule where code_fldname = 'multiout') |
 |
|
Girlnet
Yak Posting Veteran
77 Posts |
Posted - 2007-11-15 : 15:28:38
|
Thanks for the help. Tried different version of this alreay, butGetting this . . . (0 row(s) affected) |
 |
|
Girlnet
Yak Posting Veteran
77 Posts |
Posted - 2007-11-15 : 15:48:19
|
My bad! I had my filter criteria wrong - it was multi_out_tool. That worked like a charm! Told you I was a goober today!Thanks for the inspiration! |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
|
|