Ask Your Question
2

does base suppor sql union statement? [closed]

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

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

Comments

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

2 Answers

Sort by » oldest newest most voted
2

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

w_whalley gravatar image

Although my comment above is accurate, I've discovered that with LO 3.5.4.2 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
1

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

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

Stats

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

Seen: 3,680 times

Last updated: Aug 08 '12