Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL HELP ?

Re: SQL HELP ?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Tue, 24 Apr 2001 22:50:55 -0700
Message-ID: <3AE665BF.61641D10@exesolutions.com>

I'm not sure from your description exactly what you are trying to do but I can not resist the urge to preach.

The reason, it appears to me, that you are having this problem is that you have used a relational database to violate all of the rules with respect to how a relational database should be built.

I am not surprised it is slow. It will always be. I will not be surprised that your work is extremely difficult. It should be.

I would take this opportunity to correct a whole lot of current and future problems by normalizing it. No matter how much screaming and yelling some people may do when you suggest this ... it will be far less than the screaming and yelling you will hear for years while people try to use this thing.

Daniel A. Morgan

Phil Paston wrote:

> Hi -
> I don`t know if this is the correct newsgroup appologies if it is not.
>
> I have a very large oracle table with 4 date columns in it date1 date2 date3
> and date4
>
> Is it possible in sql to write a single query that will give me : the max of
> date1 and date3 in a new column and the min of date3 and date4 in a sepatate
> column. or even better :- max of date1 and date3 - min of date3 and date4
> result in a single column. I don`t want to use a union query if I can help
> it as table is very large and i want to do the calc in one pass if at all
> possible.
>
> I am currently using a pl/sql fubction to do this but it is verry slow
> indeed and would like to solve the problem in sql is i can. I seem to recal
> that there is a sudo if that i might be able to use ??
>
> something like Decode(test the following is true or false date1 >
> date3,'YES',DATE1,DATE3)-Decode(test the following is true or false date2 <
> date4,'YES'DATE2,DATE4)AS DATECALC
>
> Any ideas would be appreciated
> Cheers
> Phil
>
> Ps if anyone would care to email me the answer as my newsgroup update takes
> several hours p.paston_at_btinternet.com
Received on Wed Apr 25 2001 - 00:50:55 CDT

Original text of this message

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