Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shifis
Posting Yak Master
157 Posts |
Posted - 2006-03-24 : 18:04:07
|
| I have table that have information of the Course that a person took, it have the next fields:CompanyIDEmployeeCourseNumberGradeDateOne person can take the same course more that ones, how can I do a query that only gave me the list and calification per Employee of the last course the he took.For exampleEmployee:40887company courseNumber Grade Date2000 257 100.00 2006/01/242000 257 92.50 2006/02/052000 257 98.00 2006/03/212000 175 100.00 2006/02/052000 147 89.00 2006/01/01 2000 147 87.00 2006/01/12The query must return 2000 257 98.00 2006/03/212000 175 100.00 2006/02/052000 147 87.00 2006/01/12 (I hope you undestand my English) |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-03-24 : 19:53:22
|
[code]select *from yourtable twhere IDEmployee = 40887and Date = (select max(Date) from yourtable x where x.IDEmployee = t.IDEmployee and x.CourseNumber = t.CourseNumber)[/code] KHChoice is an illusion, created between those with power, and those without.Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant |
 |
|
|
|
|
|