我有多个列如如何计算前3结果
表RacerID | Round1 | Round2 | Round3 | Round4 | Total
2 100 100 96 99 395
5 99 97 100 96 392
如何可以查询出从列(ROUND1,round2,round3,round4),使得它应该显示顶层3的结果
racerid | Top3Rounds
2 299
5 296
非常感谢:)
你想sql查询或php代码?你有什么尝试吗?的 – Jigar 2015-02-23 08:23:38
可能重复[多列的SQL MAX?(http://stackoverflow.com/questions/71022/sql-max-of-multiple-columns) – Tom 2015-02-23 08:23:46
你也考虑正常化你的数据结构。 – 2015-02-23 08:31:31