Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Inline Views
sdgreenwood_at_ybs.co.uk wrote:
>
> I have never used inline views and would like to know more about
> them.
An inline view is a subquery in the FROM clause, such as:
select USERNAME, NUM_LOGINS
from (
select USERNAME, count(*) NUM_LOGINS from LOGINS group by USERNAME );
It could be used as above, where you want to join to another table based on an aggregate value. I've done this quite a bit for queries against transaction data.
I've also used them where I want an outer join involving three tables: TABLE3 is joined to one column of TABLE1 and one column of TABLE2. By joining (inner) TABLE1 and TABLE2 in an inline view, I was able to do the outer join against this view.
-kdg Received on Fri Feb 05 1999 - 09:29:53 CST