Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 refering to inner online tables vs #temptables

Author  Topic 

heze
Posting Yak Master

192 Posts

Posted - 2006-09-22 : 18:51:14
Hi
I am trying to refer to a column produced in an inner online table but sqlserver cpmplains "the aggregations_flat1 table does not exist"

Im doing the following:
select *,myField=(
select somefieldOperation
from aggregations_flat1
)
from (
select fields
from myTable
)aggregations_flat1
------
BUT, if I use a temp table to define aggregations_flat1
such as:

select fields
into #aggregations_flat1
from myTable

AND then I do:

select *,myField=(
select somefieldOperation
from #aggregations_flat1
)
-------

in the later case the query works just fine, is there a problem with my first approach? Im trying to avoid the temp table

thanks






robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-09-22 : 18:56:26
quote:
inner online table
The correct term is "derived table" or "subquery".

I don't understand what you're trying to accomplish here. Is this your actual code or just an example? If it's just an example, please post your actual code and some sample input and output data so we can see what you're trying to accomplish.
Go to Top of Page
   

- Advertisement -