Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经查看了许多关于从列名中选择最小值的问答,即 找到最小值和最大值 ,但我的问题没有解决。
SELECT MIN(column1 + (5 * 24 * 60 * 60) AS deadline1, column2 +(1 * 24 * 60 * 60) AS deadline2) AS deadline FROM table_name
显示错误代码Error Code : 1064
Error Code : 1064
如何从两个值中选择最小值?有什么想法吗?
MySQLMIN仅用作聚合函数。要选择几个表达式中的最小值,您必须使用LEAST:
MIN
LEAST
SELECT LEAST(column1 + (5 * 24 * 60 * 60), column2 +(1 * 24 * 60 * 60)) AS deadline FROM table_name