DELETE FROM sys_user WHERE id NOT IN ( SELECT dt.minno FROM ( SELECT MIN(id) AS minno FROM sys_user GROUP BY openid ) dt ) and openid is not Null