问教一条SQL语句
表名有day char(12),hour char(12) ,data int
如果一条语句找出某天24小时的数据呢?
我只想到了一个超长的SQL语句。
select data from *** where
day = ' ' and ( hour = '1 ' or hour= '2 '....... ) ;
我只会这样写,请问一下有其它更好的方法吗?
[解决办法]
select data from *** where
day = ' ' and cast(hour as int) > = 1 and cast(hour as int) <= 24;