MySQL之——GROUP BY分组取字段最大值
摘要:方法一:(效率最高)select * from test as a where typeindex = (select max(b.typeindex) from test as b where a.type = b.type );方法二:(效率次之)select a.* from test a,(
阅读全文
posted @
2017-08-30 13:50
vofill-work
阅读(6119)
推荐(2)
mysql日期加减
摘要:一、MySQL 为日期增加一个时间间隔:date_add()。 1、 示例: set @dt = now(); select date_add(@dt, interval 1 day); - 加1天 select date_add(@dt, interval 1 hour); -加1小时 selec
阅读全文
posted @
2017-08-28 09:36
vofill-work
阅读(424)
推荐(0)
iText输出中文的三种字体选择方式
摘要:1、使用iTextAsian.jar中的字体 BaseFont.createFont("STSong-Light", "UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);2、使用Windows系统字体(TrueType) BaseFont.createFont("C:/WIN
阅读全文
posted @
2017-08-15 16:28
vofill-work
阅读(5107)
推荐(0)
fastJson顺序遍历JSON字段
摘要:fastJson在把json格式的字符串转换成JSONObject的时候,使用的是HashMap,所以排序规则是根据HASH值排序的,如果想要按照字符串顺序遍历JSON属性,需要在转换的时候指定使用LinkedHashMap代替HashMap。
阅读全文
posted @
2017-08-03 19:49
vofill-work
阅读(1153)
推荐(0)