-
(1) 更新一个列:update T_Person set Age=30
-
(2) 更新多个列:update T_Person set Age=30,Name=’Tom’
-
-
(3) 更新一部分数据:update T_Person set Age=30 where Name=’Tom’,用where语句表示只更新Name是’Tom’的行,注意SQL中等于判断用单个=,而不是==。
-
-
(4) where中还可以使用复杂的逻辑判断:
-
update T_Person set Age=30 where Name=’Tom’ or Age<25. or相当于C#中的||(或者)。
-
-
(5) where中可以使用的其他逻辑运算符是:or,and,not,<,>,>=,<=,!=(或< >)等。
原文地址:
http://bbs.delit.cn/thread-156-1-1.html
转载请注明出处:
撰写人:度量科技
www.delit.cn
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/328153/viewspace-1815206/
,如需转载,请注明出处,否则将追究法律责任。