【发布时间】:2023-04-09 21:22:02
【问题描述】:
- 数据库:网球
- 表:匹配
- 列:matchno(pk)、赢、输...等
问题: 获取每场比赛的比赛编号和输赢盘数,其中赢盘数 >= 输盘数乘以 2。
查询错误:
use tennis;
select matchno, lost * 2 AS spl
from matches
where won >= spl
这个查询有什么问题?如何修改它以获得正确的输出?
正确查询:
select matchno, won, lost
from matches
where won >= lost * 2
【问题讨论】: