Home » SQL & PL/SQL » SQL & PL/SQL » Derived SQL (Oracle 10g)
Derived SQL [message #437390] Mon, 04 January 2010 03:43 Go to next message
suryac8
Messages: 6
Registered: December 2009
Junior Member
Hello All,

Do we have any post related to the below type of SQL.
Is this called Derived SQL?

select s1.col1 as A,s2.col4 as B from

( select a.prod_key as Col1 ,a.gl_journal_key as col2,a.customer_key as col3
from biw_01.prod_dim t1,biw_01.gl_journal_line_dim t2, biw_01.customer_dim t3, biw_01.gl_journal_line_fct a
where a.prod_key=t1.prod_key and
t2.gl_journal_key=a.gl_journal_key and
t3.customer_key=a.customer_key
) s1
inner join
(
select t4.sales_order_line_key as Col4,t5.Prod_key as Col5
from
biw_01.sales_order_line_fct t4,biw_01.Prod_dim t5,biw_01.sales_order_line_dim t6
where
t4.sales_order_line_key=t6.sales_order_line_key and
t5.prod_key=t4.prod_key
) s2

on s1.col1=s2.col5 edless to say I am a new bie .

Re: Derived SQL [message #437394 is a reply to message #437390] Mon, 04 January 2010 03:56 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Derived SQL, or rather derived table SQL, is not Oracle term.
In Oracle it is called inline view.
It is a (sub)query inside FROM clause.

So yes, your statement contains inline view/derived table.

Regards
Michel
Re: Derived SQL [message #437395 is a reply to message #437390] Mon, 04 January 2010 03:58 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I've never heard of that being described as Derived SQL.

In a query of the form:
SELECT <column list A>
FROM (query)
the query you are selecting from is called an Inline View.

A bit of Googleing reveals that Sybase (and possibly other Dbs) call this a SQL Derived Table - is that what you're thinking of?
Previous Topic: utl_dbws how to
Next Topic: PLS-00201
Goto Forum:
  


Current Time: Sun Feb 09 22:33:48 CST 2025