不符合要求!table song name time text sky 20000823 111111111111111111111111111111111111select # from song ????后面怎么写?要求把20000823的记录都显示出来!明天的话就显示24的
select * from song where convert(int,substring(time,5,2))=datepart(month,getdate()) and convert(int,substring(time,7,2))=datepart(day,getdate())
select * from song where time=convert(char(8),getdate(),112)
dmao的很正确,谢谢!!!我已经给你分了!!
select * from song where to_char(time,'yyyy/mm/dd') = :vs_today; --vs_today eg.. 2000/08/23 --或者 select * from song where to_char(time,'yyyymmdd') = :vs_today; --vs_today eg..20000823
name time text
sky 20000823 111111111111111111111111111111111111select # from song ????后面怎么写?要求把20000823的记录都显示出来!明天的话就显示24的
where convert(int,substring(time,5,2))=datepart(month,getdate())
and convert(int,substring(time,7,2))=datepart(day,getdate())
where to_char(time,'yyyy/mm/dd') = :vs_today;
--vs_today eg.. 2000/08/23
--或者
select * from song
where to_char(time,'yyyymmdd') = :vs_today;
--vs_today eg..20000823
在进行关于日期方面的条件判断时,使用Oracle提供的to_char函数是非常方便和简单的