|
Posted by steve on 10/03/07 19:50
On Oct 3, 6:58 am, Serge Rielau <srie...@ca.ibm.com> wrote:
>The intent of a CTE is that it is referenced. The same isn't necessarily
>true for columns in the select list (positional bind-out of a cursor)
Hi,
So your explaining another aspect of 'referential' integrity. :-)
I reference it (CTE,Order By etc) the integrity is checked and
enforced.
And if I don't reference it it's my tough luck or my oversight and I
could wind up with a big mess?
Interestingly, it does resemble the logic of a FK reference in a
twisted way. But here chance seems to play a major part :-)
These queries go happly on their merry way:
SELECT a.orderid,a.customerid as Cust,a.shipcountry as
Cust,b.productid
FROM orders as a join [order details] as b
on a.orderid=b.orderid
SELECT a.orderid,a.orderid,a.customerid as Cust,a.shipcountry as
Cust,b.productid
FROM orders as a join [order details] as b
on a.orderid=b.orderid
best,
steve
www.beyondsql.blogspot.com
[Back to original message]
|