Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Legal syntax or fluke?

Legal syntax or fluke?

From: Mike Schuler <maxmike_at_dbsurfer.com>
Date: Sat, 27 Feb 1999 09:44:02 -0600
Message-ID: <36D812C2.6B8B@dbsurfer.com>


/* Display duedate for DBA.cust_order with each average of balance by duedate between 400 and 500 */

select t1.duedate
from "DBA".cust_order t1
where t1.duedate in

        (select t2.duedate
        from "DBA".cust_order t2
        where not exists
                (select *
                from "DBA".cust_order t3
                where t2.duedate = t3.duedate
                having avg(t3.balance) not between 400 and 500))

I have a product that generates the above syntax from the input comment, but it only works on Oracle8 (not DB2 and not Sybase). Regardless of the sanity of the statement - is it actually legal in ANSI SQL? Thanks for any hints.

--
Mike Schuler
http://www.dbsurfer.com
Voice 604.926.2676
Sent from Netscape:Oahu node Received on Sat Feb 27 1999 - 09:44:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US