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: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Thu, 10 Jun 2004 17:55:25 -0700
Message-ID: <1086915340.83966@yasure>


Spendius wrote:

> 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
> --
> --5 rows selected.
> i.e. get rid of this redundant information.
>
> Someone has a solution perhaps ?
> Thanks much !
> Regards,
> Sp

My guess is that this is school work.

If it isn't ... then it seems you have a data integrity problem that needs to be addressed rather than one of writing code to cover up the flaw.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Thu Jun 10 2004 - 19:55:25 CDT

Original text of this message

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