There are two tables, table_firm и table_update . It is necessary to select firms from the table_firm table by their last activity contained in the table / field table_update.dateupdate . Table structures:
table_firm (id, name_firm) table_update (id, id_firm, dateupdate) Where,
table_firm.id = table_update.id_firm dateupdate contains the date in the form 20120212
As a result, you need to display a list of companies from the table_firm table so that companies with the smallest number first go to the dateupdate field of the table_update table.