Can someone show or refer me to an example that will accomplish this? I'll try my best to explain what I would like to do.
I want to obtain the last Customer record in my table using a FOR EACH where the city is unique, ordered by Cust, City.
For instance, if this is the data in my Customer table:
cust city amt
1800 001 222
8000 001 444
1800 001 111
1800 004 555
4000 001 777
1800 002 444
1800 002 777
1800 001 888
I want my FOR STATEMENT to return the following:
cust city amt
1800 001 888
1800 002 777
1800 004 555
I hope this makes sense.
Thanks,
CR Junk
I want to obtain the last Customer record in my table using a FOR EACH where the city is unique, ordered by Cust, City.
For instance, if this is the data in my Customer table:
cust city amt
1800 001 222
8000 001 444
1800 001 111
1800 004 555
4000 001 777
1800 002 444
1800 002 777
1800 001 888
I want my FOR STATEMENT to return the following:
cust city amt
1800 001 888
1800 002 777
1800 004 555
I hope this makes sense.
Thanks,
CR Junk