Derived SQL [message #437390] |
Mon, 04 January 2010 03:43  |
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 #437395 is a reply to message #437390] |
Mon, 04 January 2010 03:58  |
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?
|
|
|