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: Looking for a solution

RE: Looking for a solution

From: Marco Juliano <MarcoJ_at_MailAndNews.com>
Date: Sun, 3 Dec 2000 05:00:05 -0500
Message-ID: <3A6296BC@MailAndNews.com>

Thank you very much for your reply.
I'm gonna try it today, I'll let you know if it worked.

Greets,
Marco

>===== Original Message From "Conan" <conan@__no-spam__dublin.com> =====
>Hi Marco,
>If you are using Oracle 8i or above (which supports order by in an inline
>view ) you can do something like this
>
>select 12 -(rownum * 2) points,Track
>from
> (select
> track
> from table1 order by time)
>order by track
>
>If not you will have to do something like this
>
>select 12 - (pos *2 ) points , track
>from
> (select
> a.track,
> count(b.num2) pos
> from
> table1 a,
> table b
> where a.time >= b.time
> group by
> a.Track)
>order by Track
>
>hth
>
>Conan
>
>Marco Juliano wrote in message <3A281BF7_at_MailAndNews.com>...
>>Hello,
>>
>>I'm on beginner level of SQL and PL/SQL. I have a problem I can't solve, I
>>hope anyone of you can help me.
>>
>>I got a table:
>>
>>TRACK TIME
>>1 10
>>2 20
>>3 15
>>4 13
>>
>>Now I have to create a PL/SQL script (I think) that gives points to the
>>lowest
>>time and up. For example the fastest time gets 10 points, the 2nd time gets
>>8
>>points etc. How can I use a PL/SQL script or some to generate a view of
>>this?
>>Goal:
>>
>>TRACK POINTS
>>1 8
>>2 2
>>3 4
>>4 6
>>
>>Many thanks in advance,
>>
>>Marco Juliano
>>
>
  Received on Sun Dec 03 2000 - 04:00:05 CST

Original text of this message

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