SELECT id,name,MAX(date) FROM table GROUP BY name;
MariaDB [test]> select * from t1;
+------+-------+------+
| id | name | date |
+------+-------+------+
| 1 | Dima | 2017 |
| 2 | Dima | 2018 |
| 3 | Sasha | 2017 |
| 4 | Sasha | 2018 |
+------+-------+------+
4 rows in set (0.00 sec)
MariaDB [test]> SELECT id,name,MAX(date) FROM t1 GROUP BY name;
+------+-------+-----------+
| id | name | MAX(date) |
+------+-------+-----------+
| 1 | Dima | 2018 |
| 3 | Sasha | 2018 |
+------+-------+-----------+
2 rows in set (0.00 sec)
chown -R www-data:www-data /path/to/your/owncloud/install/data
For ArchLinux use:chown -R http:http /path/to/your/owncloud/install/data
chown -R apache:apache /path/to/your/owncloud/install/data