-3
               MIN( CASE
                    WHEN Type = 435 THEN TimeStamp 
               END ) AS InTime,                   
               MIN( CASE
                    WHEN Type = 324 THEN TimeStamp 
               END ) AS OutTime

上面的代码使用 min() 找到最小值,如何找到下一个最小值以及如何获取所有下一个......值......

4

1 回答 1

0
SELECT TimeStamp AS InTime
FROM MyTable
WHERE Type = 435
ORDER BY Timestamp;

SELECT TimeStamp AS OutTime
FROM MyTable
WHERE Type = 324
ORDER BY Timestamp;
于 2013-10-24T11:52:51.667 回答