Re: Should this query raise an exception?

From: --CELKO-- <71062.1056_at_compuserve.com>
Date: 17 Aug 2002 08:39:09 -0700
Message-ID: <c0d87ec0.0208170739.394fb9c2_at_posting.google.com>


CREATE TABLE T (a INTEGER NOT NULL, b INTEGER NOT NULL);

INSERT INTO T VALUES (0, 0);
INSERT INTO T VALUES (1, 1); SELECT *
  FROM (SELECT 1/a AS r, b

          FROM T) AS v (r,b)
 WHERE b <> 0;

becomes this in the parser:

 SELECT 1/a AS r, b
   FROM T
  WHERE b <> 0;

and that is what gets executed. But what bothers me is that a VIEW is required to behave as if the result table was materialized. I cannot figure out if that same rule applies to derived tables just off hand. Received on Sat Aug 17 2002 - 17:39:09 CEST

Original text of this message