aspose file tools*
The moose likes Oracle/OAS and the fly likes Can Joins  be performed on views also. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Can Joins  be performed on views also." Watch "Can Joins  be performed on views also." New topic
Author

Can Joins be performed on views also.

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 283

Can all the joins be performed on views also.
I tried inner join ,outer join it works.

I asked this question because In every book when they start taking about joins they talk about joining tables.
Not a single word about joining tables and views and joining views.

But I see some questions joining views ,at first I was surprised.


Oracle Java Programmer , Oracle SQL Expert , Oracle Java Web Component Developer
Tim Cooke
Bartender

Joined: Mar 28, 2008
Posts: 1130
    
  59

You appear to have asked and answered your own question.


Tim Driven Development
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Actually, views can be used in many places where tables are allowed. This also is what makes them useful. An application doesn't even necessarily need to know whether it is querying a table or a view.

Some views can even be updatable, meaning you can insert, update or delete records in them. Rules determining which views are updatable can differ slightly among databases. Generally, if there is a one to one relationship between rows in a view and rows in the underlying table(s), the view can be updated. So, for example: is usually updatable in most databases, while isn't.

Sometimes even views containing joins can be updated, but this is where the topic starts to get somewhat complicated.
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1772
    
  14

In queries, you can treat views as if they were tables i.e. you can do joins, sub-queries etc. But it can be helpful to know what the SQL is doing underneath, especially in more complex views. You could have several views that perform similar queries underneath, so when you join them, you are effectively forcing the database to do unnecessary work. In this situation it might be better to write a fresh query against the tables to do exactly what you need.


No more Blub for me, thank you, Vicar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can Joins be performed on views also.