msSql 修改时间字段 - MS-SQL Server / 基础类
表A
SQL code:
autoID outDate type resultDate
1 2010-05-10 11:12:03 1 null
2 2010-05-10 15:10:03 0 null
3 2010-05-12 11:12:03 0 null
4 2010-05-14 11:12:03 1 null
5 2010-05-15 11:12:03 1 null
现在我想更改表A里的 resultDate 字段
如果type为0,resultDate 改为 outDate 加上20天后的结果
如果type为1,resultDate 改为 outDate 加上30天后的结果
修改后的结果应该为:
SQL code:
autoID outDate type resultDate
1 2010-05-10 11:12:03 1 2010-05-30 11:12:03
2 2010-05-10 15:10:03 0 2010-06-09 15:10:03
3 2010-05-12 11:12:03 0 2010-05-11 11:12:03
4 2010-05-14 11:12:03 1 2010-06-03 11:12:03
5 2010-05-15 11:12:03 1 2010-06-04 11:12:03
哪位知道的帮我解决下
谢谢
SQL code:
update ta
set resultDate=(case when [type]=0 then dateadd(day,2
相关问答:
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
从数据库中查询一张表的数据
select 部门,姓名 from tb
如何才能生成下面的xml格式
XML code:
<folder state="unchecked" label="全部">
<folder state="unchecked&qu ......
我觉得mysql和sqlserver有共同的地方:
有个问题是关于表的锁问题:
进程A 进程B
select * from user where id in lock share mode(共享锁)
&nb ......