问题: 获取匹配编号以及在每场比赛中获胜和丢失的集合,其中赢得的数量为> =丢失的集合数量乘以2。
查询错误:
use tennis;
select matchno, lost * 2 AS spl
from matches
where won >= spl
此查询有什么问题?如何修改以获得正确的输出?
正确查询:
select matchno, won, lost
from matches
where won >= lost * 2
答案 0 :(得分:4)
SELECT matchno, lost * 2 AS spl
FROM matches
WHERE won >= (lost * 2)