>>I am having trouble isolating records in a table that have the highest price but the nouns are the same. So if there are 50 tables, 25 chairs, 200 lamps with varying prices for each, I want a list of 3 items, a table, a chair, and a lamp, with each of the 3 having the highest price in its category.
>>Is there a way to prg this in foxpro or is sql needed?
>
>
SQL is the easiest way Tim IMHO.
>Select itemname, max(price) as Highest from mytable group by 1
Cetin, I have implemented the following:
select *,max(price) from l:dlytrans group by LMCA_NBR;
where todaydt=CTOD(CHOSDATE) and price>=2500 INTO CURSOR Ernie DIST
now there are 3 items with same lmca_nbr and 3 different prices but the one with the cheapest price shows up. I want the most expensive.
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."