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: to all SQL experts...

Re: to all SQL experts...

From: D.Y. <dyou98_at_aol.com>
Date: 27 Aug 2002 22:35:50 -0700
Message-ID: <f369a0eb.0208272135.53fec8aa@posting.google.com>


"Sergey Adamenko" <adamenko_at_i.com.ua> wrote in message news:<ake2kh$12hp$2_at_news.dg.net.ua>...
> "D.Y." <dyou98_at_aol.com> ???????/???????? ? ???????? ?????????:
> news:f369a0eb.0208260916.2fc98edf_at_posting.google.com...
> > Got to admit that I haven't seen a smart query like this in a while.
> > That sum(sqrt) with group by is tricky. Congratulations. This query
> > should work unless there are duplicates in some matching groups but
> > not the others.
> >
>
> Hi!
> I think of it before sending the query and had same doubts as you. And I should
> say that it have to work with duplicates.
> Consider, for example, the function:
>
> S = sqlrt(a1*b1)+sqlrt(a2*b2), where a1+a2=b1+b2=CONST, and a1>=1, a2>=1, b1>=1,
> b2>=1.
>
> If gives its maximum, according to differential calculus, on a1=b1, a2=b2
> That is:
>
> sqlrt(a1*b1)+sqlrt(a2*b2) <= a1+a2, or
> sqlrt(a1*b1)+sqlrt(a2*b2) <= b1+b2
>
> and
>
> sqlrt(a1*b1)+sqlrt(a2*b2) = a1+a2, where a1=b1, a2=b2.
>
> I didn't wrote formulas for
>
> S = sqlrt(a1*b1)+sqlrt(a2*b2)+ sqlrt(a3*b3)
>
> But I think it'll be similar for the inequality:
>
> sqlrt(a1*b1)+sqlrt(a2*b2)+ sqlrt(a3*b3) <= a1+a2+a3,
> where a1+a2+a3=b1+b2+b3=CONST, and a1>=1, a2>=1, a3>=1, b1>=1, b2>=1, b3>=1
>
> OK for now, I can be wrong with the assumption (we all can make errors :-) ) .
> But can you show its wrong?

No, to identify groups whose values match record by record, your query is pretty solid. I was thinking if I could use a slightly altered form of your query to find out groups whose distinct values match up such as, col1 col2


1        3
1        4
2        3
2        4
2        3

Look like it can be done.

>
> Best regards,
> Sergey Adamenko.
Received on Wed Aug 28 2002 - 00:35:50 CDT

Original text of this message

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