This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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 Java Interview Guide this week in the Jobs Discussion 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

Can Joins be performed on views also.

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 388

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, Oracle Web Service Developer
Tim Cooke

Joined: Mar 28, 2008
Posts: 2534

You appear to have asked and answered your own question.

Tim Driven Development
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3733

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

Joined: Mar 01, 2009
Posts: 2296

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:
subject: Can Joins be performed on views also.
It's not a secret anymore!