嗨,我是 mysql 数据库的新手,任何人都可以解决我的问题吗?我有三个这样的表
select * from device;
Vehiclegroup vehicleName deviceid accountid
------------ ----------- -------- -----------
sms cargo test1 sysadmin
sms cargo1 test2 sysadmin
sms cargo3 test3 sysadmin
select * from Account;
accountid password deviceid
--------- -------- ----------
sysadmin pass test3
sysadmin pass test2
sysadmin pass test1
And finally
mysql> select * from eventdata;
+-----------+-------+----------+----------+
| accountid | speed | date | deviceid |
+-----------+-------+----------+----------+
| sysadmin | 45 | 12/10/13 | test3 |
| sysadmin | 45 | 10/10/13 | test3 |
| sysadmin | 45 | 10/10/13 | test2 |
| sysadmin | 45 | 11/10/13 | test2 |
| sysadmin | 45 | 14/10/13 | test2 |
| sysadmin | 45 | 17/10/13 | test2 |
| sysadmin | 45 | 17/10/13 | test1 |
+-----------+-------+----------+----------+
7 rows in set (0.00 sec)
这里我需要如下所示的输出表
vehiclegroup vehiclename deviceid date
sms cargo1 test1 17/10/13
sms cargo2 test2 17/10/13
sms cargo3 test3 12/10/13
即,我需要每个设备在最后一个工作日期的数据,任何人都可以为此提供帮助