contoh :
SELECT a.NM_SHIFT, MIN( a.OFFERED ) AS c, ( (
SELECT b.OFFERED
FROM `patern_shift` b
WHERE b.NM_SHIFT = a.NM_SHIFT
ORDER BY b.OFFERED ASC
LIMIT 1 , 1
) - MIN( a.OFFERED )
) AS diff
FROM `patern_shift` a
GROUP BY a.NM_SHIFT
flag merag menunjukan data Min kedua
flag biru menunjukan data Min kesatu
Tidak ada komentar:
Posting Komentar