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 |
|
nitsmooth
Yak Posting Veteran
68 Posts |
Posted - 2010-01-15 : 06:10:52
|
| This is my assignment tableCAllId Resolution ------- ----------- 00013182 00013182 00013182 00013182 Completed00013232 00013232 Completed00013232 00013232 Completed00013268 00013268 Completed00013268 Completed00013269 00013395 00013449 CompletedWhat i want is if for a particular callid in assignment table all the reslolution's are completed then mark that callid's resolution in calllog table as completedHow can i do this ...?Can this be done in a single query both checking the assignment table and updating the callLog tableCallLog TableCallid resolution------ ----------000131820001323200013268....... |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-01-15 : 07:04:29
|
Assuming that every Callid in assignment has at least one entry in CallLog:update cset resolution = 'Completet'from CallLog cwhere not exists (select * from assignment a where a.Callid = c.Callid and a.resolution <> 'Completed') No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-01-15 : 07:23:18
|
AddAND resolution <> 'Completed' to the WHERE clause??(note typo in the SET statement, I'm sure the O/P can handle that, but there seem to be lots of impetuous folk around who just do Cut&Paste and press GO |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-01-15 : 08:47:06
|
quote: Originally posted by webfred Assuming that every Callid in assignment has at least one entry in CallLog:update cset resolution = 'Completed'from CallLog cwhere not exists (select * from assignment a where a.Callid = c.Callid and a.resolution <> 'Completed')and resolution <> 'Completed' No, you're never too old to Yak'n'Roll if you're too young to die.
Thanks Kristen  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|