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: Mark D Powell <Mark.Powell_at_eds.com>
Date: 9 Jun 2004 09:23:12 -0700
Message-ID: <2687bb95.0406090823.165aa3f4@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

The solution is pretty obvious: logically shouldn't the start value be less than the end value?

A simple sub-query filter or a delete where ... would fix this.

I do not like to be critical since anyone can have a case of brain fade, but if you are in school and are planning to major in an IT related field you might want to reconsider. That, or you need to develop a system about how to go about solving problems.

HTH -- Mark D Powell -- Received on Wed Jun 09 2004 - 11:23:12 CDT

Original text of this message

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