[Problem Description]
in the aggregate query, character type field can be re-grouped to the actual content?
Example:
- Inserting data strings comprising
db.cs.cl.insert ({A: { "20,190,101,000,000"}})
db.cs.cl.insert ({A: { "20,190,101,111,111"}})
db.cs.cl.insert ({ a: { "20190103000000"}} ) - Execute aggregate queries, you can achieve the string format grouped by 20,190,301 contents of this section to re?
【Solution】 - SequoiaDB aggregate function does not currently support certain contents of the string group, supports only group the entire string to weight
- From the customer's point of view the problem, the customer will want to turn into a timestamp string format of the content to be grouped time, the most convenient way is to be achieved by the SQL syntax
- The problem for the customer, may be utilized SequoiaSQL-MySQL / SequoiaSQL-PostgreSQL + SequoiaDB tool, using standard SQL statements implemented timestamp string format converted into a packet to be re-date content, for example:
1) to build the table using the SQL statement:
MySQL> Create Table T1 (A char (16));
2) inserting data
MySQL> iNSERT INTO T1 values ( "20,190,101,000,000");
MySQL> iNSERT INTO T1 values ( "20,190,101,111,111");
MySQL> iNSERT INTO T1 values ( "20,190,103,000,000 ");
3) the use of SQL statements will be transferred into a date format string to re-grouping the contents
. mysql> select count (a) , date_format (a '% Y-% m-% d') a from t1 group by date_format ( A, 'M-%%% Y-D');
. 4) step 3 query results are as follows:
COUNT (A) A
2 2019-01-01
. 1 2019-01-03 - If the content of the non-stamp format string, date of the content can not be converted into a packet to be re-