I’m trying to debug a SELECT statement containing a UNION. I am running Libreoffice Base 7.3.7.2 on Linux Mint 21.3, and I’m using native embedded HSQLDB. I’m getting different results in different places, and I don’t understand what or why there are differences.
- When I run the view in the view SQL editor with “Run SQL directly” enabled, it gives me the expected result.
- When I run the view in the view SQL editor without “Run SQL directly” enabled, I get a SQL syntax error (with no specific error message pointing to the syntax problem).
- When I double click on the view from the main screen to open the Table Data View, I get some of the results I expect. It looks like I’m getting data from the first join in the UNION, but not the other. When I reverse the order of the UNION, I again get data from the first join in the UNION, but not the other.
I have run this query through a few different LLM’s and none of them flagged any serious issues. How can I go about debugging this?