maidinhdan > 02-03-15, 01:01 AM
SELECT Tencot1, Tencotnaobancanhien,
( SELECT COUNT (T1.Tencotcanxephang)
FROM
[TenbangA] AS T1
WHERE T1.Tencotcanxephang < T2.Tencotcanxephang) AS Xephang
FROM
[TenbangA] AS T2
ORDER BY Tencotcanxephang DESC
SELECT T2.MANV, T2.HOTEN, T2.DIACHI, T2.MADV, (Select count(T1.NGAYCONG)
FROM BANGLUONG AS T1
Where T1.NGAYCONG < [T2.NGAYCONG]+1) AS Xephang
FROM BANGLUONG AS T2
ORDER BY T2.NGAYCONG DESC;
SELECT * FROM BANGLUONG
WHERE NGAYCONG In (SELECT MAX(NGAYCONG) from BANGLUONG;);