Mysql maximum rows values -
i using mysql database application. select max(table1.created_at,table2.created_at) table
1.how find maximum values multiple timestamp columns ?
2.how add 2 time stamp value
for question #1:
select greatest(max(cola), max(colb)) tablename;
for question #2, read mysql time functions: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html
edit
if 2 columns different tables:
select greatest( (select max(created_at) table1), (select max(created_at) table2) );
Comments
Post a Comment