我想把一段时间之内的人数统计一下sql语句是:select count(*) as total from aa where time
between 2004-7-16 7:22:57' and '2004-8-16 7:22:57' 但是提示我,列无效,我该怎么写这个时间格式阿
并且我是想把这个sql语句写到.net后台代码中,作为一个sql语句,那样应该怎么写呢
...全文
916打赏收藏
在oracle中,这个sql语句怎么写
我想把一段时间之内的人数统计一下sql语句是:select count(*) as total from aa where time between 2004-7-16 7:22:57' and '2004-8-16 7:22:57' 但是提示我,列无效,我该怎么写这个时间格式阿 并且我是想把这个sql语句写到.net后台代码中,作为一个sql语句,那样应该怎么写呢
select count(*) as total from aa where time
between to_date(2004-7-16 7:22:57','yyyy-mm-dd hh:mi24:ss') and to_date('2004-8-16 7:22:57','yyyy-mm-dd hh:mi24:ss')
这样就可以了