select case
when (date3 is null and date2 is not nul) then
((Now-date2)+(date2-date1))/365 as day
when (date2 is null and date3 is not nul) then
(date3-date1)/365 as day
end
from tabName
when (date3 is null and date2 is not nul) then
((Now-date2)+(date2-date1))/365 as day
when (date2 is null and date3 is not nul) then
(date3-date1)/365 as day
end
from tabName
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货