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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -