Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

Reusing views to do aggregate queries [closed]

$
0
0

I have created some views which give me some values.

So some thing like the following

select from a table of all ids gives me some thing like

id1
id2
id3
id4

view1 gives me

id1 2
id1 1
id1 3
id2 1 

view2 gives me

id3 London
id3 Paris
id1 London

What I need is some thing like

id1  6  1
id2  1  0
id3  0  2
id4  0  0

As you can see that I need aggregation of numbers from first view and aggregation of number os cities from second view. What would be a way to do this?


Viewing all articles
Browse latest Browse all 717

Trending Articles