Using views with SQL derived tables  Chapter 10: Partitioning Tables and Indexes

Chapter 9: SQL Derived Tables

Correlated attributes

Correlated attributes that exceed the scope of a SQL derived table cannot be referenced from a SQL derived table expression. For example, the following query results in an error:

select * from publishers
   where pub_id in 
      (select pub_id from 
         (select pub_id from titles
          where pub_id = publishers.pub_id)
       dt_publishers)

Here, the column publishers.pub_id is referenced in the SQL derived table expression, but it is outside the scope of the SQL derived table dt_publishers.





Copyright © 2005. Sybase Inc. All rights reserved. Chapter 10: Partitioning Tables and Indexes

View this book as PDF