Dear All,

I have two tables T1 and T2.

T1 has these columns: userid, password (userid is primary key)

T2 has these columns: sessionid, userid, logintime, logofftime (sessionid is primary key)

I wish to add one column in T1 called last_login_time.

I want to populate this new column with max(logintime) from T2 for each user. How do I do this? I tried variants of this: update T1, T2 set last_login_time = max(logintime) where T1.userid = T2.userid.

Thanks

Ravi.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to