We help IT Professionals succeed at work.

SQL get last three course rows for each employee

72 Views
Last Modified: 2018-12-19
Hi:
I need to have the latest three course  rows for each employee
tblCourse
          empNo
         courseName
         courseEndDate
please help me do so.
note:
I had try "LIMIT" but I encountered "Incorrect syntax near 'LIMIT'".
So please try any solution other than LIMIT
Comment
Watch Question

Obadiah ChristopherDeveloper User Interface
CERTIFIED EXPERT

Commented:
Select top 3 empNo, courseName, courseEndDate from tblCourse order by courseEndDate desc
Mohammad Alsolaimanapplication programmer

Author

Commented:
How about the other employees?
I think this will retrive only first three rcirds. While my question is to retrive the last three courses for each employee.
EE Topic Advisor
CERTIFIED EXPERT
Most Valuable Expert 2014
Awarded 2013
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Mohammad Alsolaimanapplication programmer

Author

Commented:
thanks to all for participating answering my question, especially PortletPaul (awesome).

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions