select p.*
from (select p.*,
(@rn := if(@c = club_name, @rn + 1,
if(@c := club_name, 1, 1)
)
) as rn
from players p cross join
(select @rn := 0, @c := '') params
order by club_name
) p join
(select club_name, count(*) as cnt
from players p
group by club_name
) pc
on p.club_name = pc.club_name
order by rn * (@rn / cnt);
)答案 0 :(得分:1)
试试这个:关闭你的项目和你的Xcode; 右键单击项目并选择Show Package Contents,然后打开xcuserdata文件夹并删除[username] .xcuserdata文件夹。 打开Xcode,清理项目并为设备构建一次(不适用于模拟器)。 它对我有用。