Ask Your Question

does base suppor sql union statement? [closed]

asked 2012-07-31 23:00:16 +0200

geroldr gravatar image

for the following statement:

SELECT * FROM "Contacts" UNION SELECT * FROM "csv_contacts"

I get the message: The given command is not a SELECT statement. Only queries are allowed.

Is there a special way of handling this query or is UNION not supported?

Thanks, Gerold

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-17 16:14:31.990175


w_whalley gravatar imagew_whalley ( 2012-08-01 02:18:26 +0200 )edit

That link is invalid.

stewalk675 gravatar imagestewalk675 ( 2020-12-08 04:27:29 +0200 )edit

2 Answers

Sort by » oldest newest most voted

answered 2012-08-01 13:14:28 +0200

w_whalley gravatar image

Although my comment above is accurate, I've discovered that with LO it is sufficient to "Run SQL command directly" for UNION and UNION ALL commands. Click the SQL icon at the right side of the toolbar in the Query Design window to set this option.

Additionally, this LO version now accepts comments (/* comment */ or -- comment) in the SQL editing window and now preserves white space in the SQL command.

edit flag offensive delete link more

answered 2012-08-08 11:57:38 +0200

geroldr gravatar image

Thanks. I created two views then called them using a UNION statement using the SQL icon as suggested and it worked.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-07-31 23:00:16 +0200

Seen: 4,479 times

Last updated: Aug 08 '12