How can MySQL retrieve rows with duplicate values?
If the number of rows in the group is greater than 1 after grouping by this field, it is a duplicate row. Greater than 1 needs to be written into "having"; but only use group + having can only get the aggregate value, not the detailed data. To get the details, repeated traversal with subquery is needed:
where g in
group by g
SQL has no explicit set data type, so it can't keep the subset after grouping, and then it can't perform subsequent multi-step operations on the subset, so it has to use a lengthy sub query.
This kind of set operation is more convenient with esProc SPL, as long as one line:
With an explicit set, you can perform more complex subsequent calculations on the grouped subsets, including enumeration grouping, overlapping grouping, etc. Please refer to SPL grouping
SPL statements cannot be executed directly in the database. Raw data can be obtained from the database, Excel and text through the following statements:
>T1=connect(”mysqlDB”).query(“select * from t”)
It's also easy to embed esProc into Java applications，please refer to How to Call an SPL Script in Java
For specific usage, please refer to Getting started with esProc