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

Re: Help writing SQL query

From: Damjan S. Vujnovic <damjan_at_NOSPAMgaleb.etf.bg.ac.yu>
Date: Wed, 20 Nov 2002 12:22:20 -0800
Message-ID: <arfrct$1fc$1@news.etf.bg.ac.yu>


"Tony Cantara" <tonycantara123_at_hotmail.com> wrote

> Mike, I think you have solved the approach. I couldn't fathom how to
> get around the 'loop' problem with the CONNECT BY PRIOR clause until
> seeing your code. All I have to do now is code the routines in a
> generic sense (another table with shape connectivities that may want
> to search for) so that I can, arbitrarly, count the number of
> triangles, rectangles, pentagons, shapes with triangles and rectangles
> in them, shapes with rectangles and only one triangles but no
> pentagons ...

If you want to count the exact number of triangles in a given shape, you are facing the problem of counting the same triangle twice (actually three or six times). The triangle 1231 can be "discovered" as: 1231
2312
3123,
and if you add both of the touples also as: 1321
3213
2132

So, you'll have to divide the number of "discovered" triangles by either 3 (if you find the correct way of representing shapes like the one in my previous post) or by 6 (if you are inserting both touples).

Regards & happy coding,
Damjan Received on Wed Nov 20 2002 - 14:22:20 CST

Original text of this message

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