摘要:
方法一可以使用date的getTime()方法来将当前日期格式的时间转换为毫秒数,进而相减。 long systime = new Date().getTime();//当前系统时间 long oldtime = old.getTime();//相比较的时间 Long time = (s... 阅读全文
摘要:
很高兴今天学到了一种新方法。数据库中字段类型为Long ,值可能为null,也可能是某一数。因此对该字段数值进行 +1操作时需要判断该值是null还是数值。同时实现更新操作。具体如下:update content set hits = case when hits is null then... 阅读全文