【发布时间】:2019-08-02 19:50:34
【问题描述】:
我有一列,我想使用同一列对同一列执行一些算术运算
Price
---------
10
11
12
12
14
14
14
14
如果我想知道 Price=14 的行,那么我可以使用 where 子句编写一个简单的选择查询
select * from table_name where Price = 14;
但价格列的值不断变化,如果我想要这样的东西
Latest value of Price is 10
select * from table_name where Price = Price + 4;
这应该返回值为 14 的所有行。我们如何实现这一点?
【问题讨论】:
-
你怎么知道
Price的“最新”值在你的表中是什么?
标签: mysql sql where arithmetic-expressions