|  | Posted by Simon Hayes on 09/14/05 18:34 
Oops, sorry - I left out the GROUP BY:
 select
 t.Contact,
 t.Company,
 t.Job_Title,
 t.Importance
 from
 dbo.MyTable t
 join
 (
 select Company, max(Importance) as 'Importance'
 from dbo.MyTable
 group by Company
 ) dt
 on t.Company = dt.Company
 and t.Importance = dt.Importance
 
 If this still doesn't work as you require, I suggest you post CREATE
 TABLE and INSERT statements to show a test case:
 
 http://www.aspfaq.com/etiquette.asp?id=5006
 
 Simon
  Navigation: [Reply to this message] |