i have a table as follows
rate varchar(10)
symbol varchar(5)
xDate int(15)
essentially it holds currency conversion rates for a given day (expressed as a unix timestamp)
not all currency conversion rates are published each day and i am currently use this query to retrieve two rows with the appropriate rates
the trouble is that the date for the published rate may be different between the two rows.
how may i alter the query so that it will return the rows for the latest day (up to and including a specified date) on which both currencies have published?
many thanks
rate varchar(10)
symbol varchar(5)
xDate int(15)
essentially it holds currency conversion rates for a given day (expressed as a unix timestamp)
not all currency conversion rates are published each day and i am currently use this query to retrieve two rows with the appropriate rates
Code:
select rate,symbol,max(xDate) from tablename where symbol in ('EUR', 'GBP') and xDate <=123456770
the trouble is that the date for the published rate may be different between the two rows.
how may i alter the query so that it will return the rows for the latest day (up to and including a specified date) on which both currencies have published?
many thanks