MySQL Forums
Forum List  »  Newbie

most recent record
Posted by: Alan Shiers
Date: July 17, 2005 11:08AM

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

Options: ReplyQuote


Subject
Written By
Posted
most recent record
July 17, 2005 11:08AM
July 18, 2005 01:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.