I have an SQL union statement that works fine if ‘Run SQL command directly’ is selected in the query builder ie
Select Role
, Given_Name
, Surname
from members
where Role
<> ‘’
union
Select Role #2
, Given_Name
, Surname
from members
where Role #2
<> ‘’
union
Select Role #3
, Given_Name
, Surname
from members
where Role #3
<> ‘’
union
Select Role #4
, Given_Name
, Surname
from members
where Role #4
<> ‘’
Group By Role
;
This returns the various roles with all the associated members from the members table.
However if I then use that query in a report (with Analyze SQL = Yes) it fails with the following error :-
org.libreoffice.report.ReportExecutionException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘;
) “__LibreOffice_report_result”’ at line 8
I’m running LibreOffice Version: 6.1.3.2 (x64) on WIndows 8.1 and MariaDB 10.3.11
I would like to run the report using the SQL union statement …
Have I got something wrong or is there an issue I need to be aware of ?