【问题标题】:Can't run mysql request无法运行mysql请求
【发布时间】:2017-01-25 21:59:46
【问题描述】:

我需要选择价格高于平均水平的产品(它们的名称)和价格记录,但低于 33

我的要求:

select ProductName, Price
from Products
where Price>(select avg(Price) from Products)
and
Where Price < 33;

它不工作。为什么?

提前谢谢你。

【问题讨论】:

  • “不工作”没有多大帮助。你有任何错误吗?

标签: mysql sql average


【解决方案1】:

像这样删除重复的where

select ProductName, Price
from Products
where Price > (select avg(Price) from Products)
   and Price < 33;

【讨论】:

    猜你喜欢
    • 2023-04-02
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-12
    • 2023-01-26
    • 1970-01-01
    • 2021-06-25
    相关资源
    最近更新 更多