MYSQL如何取表中月日数据较昨天变化率最大的值及日期?
发布网友
发布时间:2022-04-30 02:19
我来回答
共2个回答
热心网友
时间:2022-06-29 01:38
SELECT
a.uid,
a. DAY,
ABS((a. VALUE / b. VALUE - 1) * 100) AS ct
FROM
TABLE_test a,
TABLE_test b
WHERE
DATE_FORMAT(b. DAY, '%Y-%m-%d') = ADDDATE(a. DAY ,- 1)
AND b. MONTH = a. MONTH
AND a.uid = b.uid
ORDER BY
ct DESC
LIMIT 1
热心网友
时间:2022-06-29 01:38
Nobody played the mandolin like my father