Select *
FROM orders A
Where EXISTS
(Select COUNT(1)
FROM orders
Where employeeid = A.employeeid AND orderid > A.orderid
HAVING COUNT(1) < 3)
ORDER BY EmployeeID
Select *
FROM orders A
Where EXISTS
(Select COUNT(1)
FROM orders
Where employeeid = A.employeeid AND orderid > A.orderid
HAVING COUNT(1) < 3)
ORDER BY EmployeeID