Hi there,
Given a table that has the following fields:
create table WAGE_RATES(
EMPLOYEE_ID int unsigned references EMPLOYEES,
DATE date,
HOURLY float(5,2),
WEEKLY float(5,2),
OTHER float(5,2),
index(DATE)
);
I want to run a SELECT query that uses the EMPLOYEE_ID number to compare all available records and return only the most recently entered record making use of the DATE field. What does the query look like? How do you make the database return a record based on the most recent date?
Alan
Given a table that has the following fields:
create table WAGE_RATES(
EMPLOYEE_ID int unsigned references EMPLOYEES,
DATE date,
HOURLY float(5,2),
WEEKLY float(5,2),
OTHER float(5,2),
index(DATE)
);
I want to run a SELECT query that uses the EMPLOYEE_ID number to compare all available records and return only the most recently entered record making use of the DATE field. What does the query look like? How do you make the database return a record based on the most recent date?
Alan