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 |
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2008-05-19 : 19:36:04
|
Okay, so i have to check to tables against each other. if record in Table1 IS NOT in Table2 i want to set dnc to '' or null if record in Table1 IS in Table2 i want to set dnc to 'Y'currently, i have to do two passes. i was wonder if anyone would help me make this one statement.Thanks!update t1set dnc = ''from test_new.dbo.consumer t1goupdate t1set dnc = 'y'from test_new.dbo.consumer t1inner join residential.dbo.dnc on tl1=phonego |
|
|
singularity
Posting Yak Master
153 Posts |
Posted - 2008-05-19 : 22:42:20
|
| update t1 set t1.dnc = case when d.dnc is null then null else 'Y' endfrom test_new.dbo.consumer t1left join residential.dbo.dnc d on t1.tl1=d.phone |
 |
|
|
|
|
|