I’m working on selecting data in a database and I’m not sure how to proceed.
I need to select the latest update
My tables look like this:
datatable: userid, userinfo, updated (timestamp);
usertable: userid, username, realname, email, userNumber, Org, SN, Dept.
There can be multiple entries in datatable for each user. For this query I only need the latest entry for each user from datatable:
SELECT datatable.userid,
datatable.userinfo,
datatable.updated,
usertable.username
FROM datatable
JOIN usertable ON datatable.userid = usertable.userid
WHERE (....)
Use: