Pictured above, how to use mysql to achieve?
CodePudding user response:
Write a second element aggregation function, hypothesis is secitemSelect * from table where signtime in (select secitem (signtime) from table group by name)
CodePudding user response:
Just that kind of method is a little problem, another method:Select * from table a where 1=(Select count (*) from the table where a.n ame=name and a.t ime & gt; Time)
CodePudding user response:
Remove the smallest one in each group, each group from the rest of the data the smallest can just have aSELECT * FROM TB
WHERE baoxian_id IN (
The SELECT min (baoxian_id) FROM TB
WHERE baoxian_id NOT IN (
The SELECT min (baoxian_id) FROM TB GROUP BY name)
GROUP BY name)
The ORDER BY name.
CodePudding user response: