If you have a demand, check the past 12 months of the tax trend chart, do not recommend you in the SQL Mosaic returned 12 months of data, it is likely to lead to slow SQL, it is recommended in the Java code to get the date, and then passed into the SQL based on the date to query. Get the month of the past 12 months as follows:
public static void Main (string[] args) {
localdate today = Localdate.now ();
for (Long i = 1l;i <= 12L; i++) {
localdate localdate = today.minusmonths (i);
String ss = localdate.tostring (). substring (0,7);
System.out.println (localdate);
SYSTEM.OUT.PRINTLN (ss);
System.out.println ("==============");
}
Print as follows:
2018-03-18 2018-03 ============== 2018-02-18 2018-02 ============== 2018-01-18 2018-01 = =
======== 2017-12-18 2017-12 ============== 2017-11-18 2017-11 ============== 2017-10-18 2017-10 ==============
2017-09-18 2017-09 ============== 2017-08-18 2017-08 ============== 2017-07-18 2017-07 ============== 2017-06-18 2017-06 ============== 2017-05-18 2017-05 ============== 2017-04-18 2017-04