CREATE CURSOR cust (pk int, name c(10)) CREATE CURSOR orders (pk int, date d, custfk int) INSERT INTO cust VALUES (1, "ADAMS") INSERT INTO cust VALUES (2, "BROWN") INSERT INTO cust VALUES (3, "COOPER") INSERT INTO orders VALUES(1, DATE()-2, 1) INSERT INTO orders VALUES(2, DATE()-1, 1) INSERT INTO orders VALUES(3, DATE(), 1) INSERT INTO orders VALUES(4, DATE()-2, 2) INSERT INTO orders VALUES(5, DATE()-1, 2) INSERT INTO orders VALUES(6, DATE(), 2) INSERT INTO orders VALUES(7, DATE()-3, 3) SELECT cust.pk, cust.name, MAX(date) FROM cust JOIN orders ON cust.pk = orders.custfk GROUP BY cust.pk, cust.name>I have a two tables which essentially have a one to many relationship. Let's call the first one custmrs and the second one orders. I want to have a SELECT statement will return matching results that only shows the most recent order for each customer.