我有一个MySQL表格,看起来像这样:
Name | Pass | Fail | Pass Percent | Fail Percent
Abdy | 20 | 5 | |
Bob | 10 | 5 | |
Cantona | 40 | 10 | |
Dave | 30 | 20 | |
我正在尝试获取百分比:
例如: passpercent = (pass/pass+fail)*100
我能否用单个MySQL代码填充表格的两列??
希望表格如下所示:
Name | Pass | Fail | Pass Percent | Fail Percent
Abdy | 20 | 5 | 80 | 20
Bob | 10 | 5 | 66 | 33
Cantona | 40 | 10 | 80 | 20
Dave | 30 | 20 | 60 | 40