Long转换成int类型

使用oracle的sum函数时:

select sum(num) from ......

返回的数据类型为Long

但是程序里需要使用int或integer类型

转换成int的方法:

return count ==null ?0 : count.intValue();

附送:

查询当前年份

扫描二维码关注公众号,回复: 1210080 查看本文章

select to_number(to_char(sysdate,'yyyy')) as year from dual

查询当前月份

select to_number(to_char(sysdate,'mm')) as year from dual

猜你喜欢

转载自weilikk.iteye.com/blog/2064971