View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 07:49 PM
David Portas
 
Posts: n/a
Default Re: Is it possible to return last row out of multiple based on row index?

SELECT S1.*
FROM Sometable AS S1
JOIN
(SELECT MAX(recordcount)
FROM Sometable
GROUP BY cardnumber, companyid)
AS S2(recordcount)
ON S1.recordcount = S2.recordcount

(untested)

--
David Portas
------------
Please reply only to the newsgroup
--


Reply With Quote