|
本帖最后由 zhucHZ 于 2013-9-27 18:40 编辑
功能是将表test中的字段 status 根据 字段saturation的值来赋值
saturation<=0.3 status=1;
0.3<saturation<=0.6 status=2;
0.6<saturation<=0.9 status=3;
saturation>0.9 status=4;
语句如下:
com.CommandText = string.Format("update test set status=1 where saturation<=0.3");
com.ExecuteNonQuery();
com.CommandText = string.Format("update test set status=2 where saturation>0.3 AND saturation<=0.6");
com.ExecuteNonQuery();
com.CommandText = string.Format("update test set status=3 where saturation>0.6 AND saturation<=0.9");
com.ExecuteNonQuery();
com.CommandText = string.Format("update test set status=4 where saturation>0.9");
com.ExecuteNonQuery();
我数据表中存了一组数据 其中saturation=0.3 ,执行上面的语句之后 按说字段status=1 结果却是 status=2,为什么???请教!!!!!
|
|