Have a look at GROUP_CONCAT: https://mariadb.com/kb/en/group_concat/ Here a little example: SELECT GROUP_CONCAT(DISTINCT User ORDER BY User SEPARATOR '\n') FROM mysql.user; This example will work for every table in a MariaDB with direct connection when pressing "Execute directly". It won't work without "Execute directly", because ORDER BY and SEPARATOR seem to be unknown in direct driver of LO. Note: When creating a form with such query and add a subform to this the GUI will ignore the connection between form and subform, because the query is set in direct SQL. So you couldn't create a form with SEPARATOR and ORDER BY together with GROUP_CONCAT. Only possibility is to create a view from the query. This will work well.