I have a problem with SQL and select union.
I have 2 simple SQL queries that I converted to views.
When I do
select pesel from v_person0
and separation
select pesel from v_person1
everything works separately (already on views), but if I want to make a union, this command:
select pesel from v_person0
union select pesel from v_person1
doesn't work anymore. I get the message 'The specified command is not a SELECT statement. Only queries are allowed. "SELECT "pesel" FROM "v_person0" UNION SELECT "pesel" FROM "v_person1" '
Of course, the PESEL field in both parts is of the same type.
I create SQL with union as a direct SQL command without any wizards. What's the problem?
[Solved] SELECT UNION problem
[Solved] SELECT UNION problem
Last edited by MrProgrammer on Mon May 15, 2023 3:13 pm, edited 2 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
LibreOffice 7.2.2.1 (x64), Windows 10
Re: Select union problem
I solved the problem and I'm terrified...
Select pesel From v_osoba0 UNION ALL Select pesel From v_osoba1
not working but now
Select "pesel" From "v_person0" UNION ALL Select "pesel" From "v_person1"
works well. It turns out that in a slect union, field and table names must be in quotation marks.
Select pesel From v_osoba0 UNION ALL Select pesel From v_osoba1
not working but now
Select "pesel" From "v_person0" UNION ALL Select "pesel" From "v_person1"
works well. It turns out that in a slect union, field and table names must be in quotation marks.
LibreOffice 7.2.2.1 (x64), Windows 10
Re: [Solved]Select union problem
Query menu: Edit>"Run SQL directly"
viewtopic.php?t=9871
(parsed mode vs. direct mode (aka "pass through")
viewtopic.php?t=9871
(parsed mode vs. direct mode (aka "pass through")
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice