Avatar of freshwaterwest
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

max timestamp from several tables with timestamp column

I have a "site last updated" in the foot of the page, I managed to use the following to do this with one table:

$query_update = "SELECT DATE_FORMAT(MAX(timestamp),'%M %e, %Y') AS lastupdated FROM news";

Now I have more tables to add and need a way to do something like this if possible:

$query_update = "SELECT DATE_FORMAT(MAX(table1.timestamp,table2.timestamp,table3.timestamp, table4.timestamp),'%M %e, %Y') AS lastupdated FROM table1,table2,table3,table4";

MySQL Server

Avatar of undefined
Last Comment

8/22/2022 - Mon