use self-correlated query
select a.itemcode, a.itemdate, a.itemprice form sourcetable a ;
where a.itemdate = (select max(b.itemdate) form sourcetable b where
a.itemcode = b.itemcode) into cursor result
ShahJagat wrote:
Quote:
Hi -
I have a table that captures the prices on the items purchased and the date
they were purchased. So this tabel would have mutiple records on the same item
since the item was purchased mutiple times.
How can I do a SQL query where it will list each item only once and the its
latest price?
Thanks in advance...
Shah |