我有以下数据:
id name score
1 sam 5
2 sam 1
3 jerry 6
4 jerry 2
5 sam 3
我希望它像
id name score
3 jerry 6
4 jerry 2
1 sam 5
5 sam 3
2 sam 1
我想在此表中执行嵌套排序我想要按类似的姓氏排序的结果,这些姓氏按分数排序
但它不起作用并且给我错误的结果可以有人告诉我该怎么做吗?
答案 0 :(得分:0)
首先,你为什么要加入这张桌子" ex"与自己?为什么你加入一个非唯一的列姓氏?
可能你需要像
这样的查询fullsetence <- as.character(c("A test setence with test length","A second test for length"))
nchar(fullsetence)
这将按姓氏对结果进行排序,并使用monthly_sales_target对姓氏进行排序。