17,382
社区成员




select * from 表
where getdate() between '生效时间' and isnull('失效时间','--@@@--')----@@@--要是空的需要看到,这里就写'9999-99-99',否则'0000-00-00'
[/quote]
oracle 好像没 isnull 用decode判断吗[/quote]
select * from 表
where getdate() between '生效时间' and isnull('失效时间','--@@@--')----@@@--要是空的需要看到,这里就写'9999-99-99',否则'0000-00-00'
[/quote]
oracle 好像没 isnull 用decode判断吗[/quote]
select * from 表
where getdate() between '生效时间' and isnull('失效时间','--@@@--')----@@@--要是空的需要看到,这里就写'9999-99-99',否则'0000-00-00'
[/quote]
oracle 好像没 isnull 用decode判断吗
select * from table
where sysdate >= start_time
and ((sysdate <= end_time and end_time is not null) or end_time is null)
--start_time生效时间 end_time失效时间
select * from 表
where getdate() between '生效时间' and isnull('失效时间','--@@@--')----@@@--要是空的需要看到,这里就写'9999-99-99',否则'0000-00-00'