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 -> Help writing SQL query

Help writing SQL query

From: Tony Cantara <tonycantara123_at_hotmail.com>
Date: 16 Nov 2002 14:56:29 -0800
Message-ID: <3d0c2563.0211161456.50f73e6c@posting.google.com>


Hi, I have designed a table that contains the following information about some simple shapes

I need a bit of help writing some SQL (Oracle 8i/9i Enterprise). I would like to query the database and count, for example, the number of shapes with triangles in them. For all the data below this would return 2 (1 for the shape that is a triangle and 1 for the shape that is a rectangle made up of 2 triangles).

If the design is bad, I would appreciate constructive critism on what would be a better design - at this stage nothing is set in concrete
(initially I thought this would be an easy query to write using a
CONNECT BY PRIOR construct clause but this doesn't work for 'cyclic/loop data' like that below).
Many thanks
Tony

CREATE TABLE tblshapes(shapeID NUMBER,node NUMBER,nextnode_linkedlist NUMBER);

Received on Sat Nov 16 2002 - 16:56:29 CST

Original text of this message

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