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 |
|
hai
Yak Posting Veteran
84 Posts |
Posted - 2009-08-19 : 17:12:00
|
| Trying to filter the record that should not have and 0 on all three( col1,col2, col3) and should be have either value must less then 100 orgreater then 500This is begin done with 2 statement...got to be a better way to write this:thanksdelete from tbl1where (col1 = 0 and col2 =0 and col3= 0)select col1,col2,col3 from tbl1where ( col1 not between 100 and 500 )or ( col2 not between 100 and 500 )or ( col3 not between 100 and 500 ) |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-08-21 : 02:18:32
|
| You dont need a deleteselect col1,col2,col3 from tbl1where not(col1 = 0 and col2 =0 and col3= 0)and(( col1 not between 100 and 500 )or ( col2 not between 100 and 500 )or ( col3 not between 100 and 500 ))MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|