cancel
Showing results for 
Search instead for 
Did you mean: 

combining multiple Select statements

0 Kudos

I'm trying to understand how webi behaves in a situation like this:

- universe with contexts

- query in webi uses objects from both contexts

- so one query would generate 2 Select statements -> normal behaviour so far.

question:

How are the 2 Select statements combined?

- Does webi send each Select separately to the db and then the db handles the combination of queries?

- Or does webi send a combined query (Select 1 + Select 2) to the db? In that case, how does webi combine the query (union, intersection)?

Many thanks in advance,

R

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

When you are applying Combined Query in Webi (Select1+Select2) the combined query is fired to the database not individually.

If your database supports combined query types then (Sel1+Sel2) will be fired to the database based on which combination you select.

In a union combination, Web Intelligence takes the all the data from both queries, eliminates duplicate rows, and builds a combined data set.

In an intersection combination, Web Intelligence returns the data that is common to both queries.

In a minus combination, Web Intelligence returns the data in the first query that does not appear in the second.

For Eg:

You have a 2 queries containing the following data.

Q1: US,UK,Spain,France

Q2: US,Germany

Now for Union the output of the combined query will be:

= US,UK,Spain,France,Germany

For Intersection the output will be:

= US

For Minus the Output will be:

= UK,Spain,France

Let me know if this helps..

Regards,

Soumyadutta Roy

0 Kudos

Thanks for your quick reply, Roy.

But that's not really the situation I have.

I don't have 2 queries.

I have one query only, generating an SQL with 2 Select Statements. In that case, how does webi combine those 2 Selects?

Thanks again,

R

Former Member
0 Kudos

In this case also the query will be considered as 1 Select with sub select query and no Union or Intersection logic will be implied on that.

Answers (0)