N
nikue
Unregistered / Unconfirmed
GUEST, unregistred user!
现有SQL2K下的一段语句,如何转到o8i下啊,
update tj_tmp set
l3=(select isnull(sum(
case
when (ty<=@d_start and ((tc>@d_end) or (tc is null)))
then 1
when (ty>@d_start and tc<=@d_end)
then isnull(datediff(mi,ty,tc)/(1440.000000*@d_length),0)
when (ty<=@d_start and tc<=@d_end)
then isnull(datediff(mi,@d_start,tc)/(1440.000000*@d_length),0)
when (ty>@d_start and ((tc>@d_end) or (tc is null)))
then isnull(datediff(mi,ty,@d_end)/(1440.000000*@d_length),0)
else 0
end
),0) from view_ysj),
在转9I下好像没有问题,但8i报错,据说8I不支持CASE,那不知如何改啊,?
谢谢啊,很急啊!!!
update tj_tmp set
l3=(select isnull(sum(
case
when (ty<=@d_start and ((tc>@d_end) or (tc is null)))
then 1
when (ty>@d_start and tc<=@d_end)
then isnull(datediff(mi,ty,tc)/(1440.000000*@d_length),0)
when (ty<=@d_start and tc<=@d_end)
then isnull(datediff(mi,@d_start,tc)/(1440.000000*@d_length),0)
when (ty>@d_start and ((tc>@d_end) or (tc is null)))
then isnull(datediff(mi,ty,@d_end)/(1440.000000*@d_length),0)
else 0
end
),0) from view_ysj),
在转9I下好像没有问题,但8i报错,据说8I不支持CASE,那不知如何改啊,?
谢谢啊,很急啊!!!