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.
| 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 somefieldOperationfrom aggregations_flat1)from ( select fields from myTable)aggregations_flat1------BUT, if I use a temp table to define aggregations_flat1such as:select fieldsinto #aggregations_flat1from myTableAND then I do:select *,myField=(select somefieldOperationfrom #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 tablethanks |
|
|
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. |
 |
|
|
|
|
|