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: SQL puzzle...

Re: SQL puzzle...

From: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 9 Jun 2004 09:38:43 -0700
Message-ID: <4b5394b2.0406090838.177c1b7c@posting.google.com>


spendius_at_muchomail.com (Spendius) wrote in message news:<aba30b75.0406090235.7842a055_at_posting.google.com>...
> I have a table containing
> --select * from graphe
> --order by 1,2
> --/
> -- START END VALUE
> -- ---------- ---------- ----------
> -- 2376 2377 3659
> -- 2377 2376 3659
> -- 2377 2399 3755
> -- 2378 2399 3005
> -- 2378 2390 6273
> -- 2390 2378 6273
> -- 2390 2552 2775
> -- 2399 2377 3755
> -- 2399 2378 3005
> -- 2552 2390 2775
> --
> --10 rows selected.
> As you can see, the relationships between START and END are
> recorded twice.
> I'd like to get with a simple -?- SELECT statement the following:
> -- START END VALUE
> -- ---------- ---------- ----------
> -- 2376 2377 3659
> -- 2377 2399 3755
> -- 2378 2390 6273
> -- 2390 2552 2775
> -- 2399 2378 3005

This question is maybe more appropriate for c.d.o.misc rather than c.d.o.server, but here's an answer anyway. Add this to the where clause:

     AND start<end ;

Have fun.
  Ed Received on Wed Jun 09 2004 - 11:38:43 CDT

Original text of this message

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