获取记录中数值排列前N位的字段名称的组合
各位大侠,请帮忙,如何快速从数据表中的记录中获取其由大到小排序前3(并列也计入)的字段名称,并写入字段yh中(如图),因总记录有近20w条,谢谢!创建测试数据
程序代码:
CREATE dbf tt(xm C(12),t1 n(5,1),t2 n(5,1),t3 n(5,1),t4 n(5,1),t5 n(5,1),t6 n(5,1),t7 n(5,1),t8 n(5,1),t9 n(5,1),yh C(20)) INSERT INTO tt values("AAA",51,71,56.7,51,11,30,41,70,22,"") INSERT INTO tt values("AAB",52,78,56.7,89,12,38,48,79,28,"") INSERT INTO tt values("AAC",53,56,53,81,13,53,45,39,25,"") INSERT INTO tt values("AAD",54,54,56.7,49,14,31,46,19,22,"") INSERT INTO tt values("AAE",55,48,56.7,89,15,33,43,29,26,"")