Select from Group by having Count (*>1
Like the above sentence, SQL executes in Oracle, but MySQL does not.
However, be aware that it will only return one piece of data. One of the words here is not the final result but one.
For example, there are 3 data of the same wxno (such as Wxno=test1), with a userid of 101,102,103, and 2 wxno the same data (such as Test2), with a userid of 104,105, respectively.
The data returned after execution is as follows:
101,104.
I found the problem when I cleared the T_wxuser table to repeat the data. After execution, the query found that there were duplicate data, which was thought to be a problem with SQL.
Look at the above line of SQL returned results only to find that this is the case.
One more thing, when you update/delete a table, your from table is not the same.
Like what:
Delete from where inch (selectfromgroupby havecount(*> 1);
This is not possible, will be an error.
Error when this is the case:
[ERR] 1093-you can ' t specify target table ' T_wxuser ' for update on FROM clause
So, there's no way to add an alias.
Delete from where inch (Select* fromGroup Count(*>1) AA);
This situation is not a problem in Oracle.
Problems with MySQL GROUP by