1

表 xy 包含以下字段:

编号 | 日期 | 价值

我希望提取特定 id 的最小值和从第 12 行开始的相应日期:

编码SELECT MIN(value) FROM (SELECT value FROM tablexy where id=1 LIMIT 11, 1000) as x

这将返回最低值,但是,我需要添加什么才能接收最低值的相关日期?

4

2 回答 2

2
    SELECT value,`date` FROM (SELECT value,`date` FROM tablexy
    where id=1 LIMIT 11, 1000)   as x  order by value limit 1;
于 2012-09-03T10:40:38.580 回答
0
SELECT field from tablexy where value = (select MIN(value) FROM (SELECT value FROM tablexy where id=1 LIMIT 11, 1000))
于 2012-09-03T10:37:08.517 回答