Alexei:

You are right that your solution was not the best from a performance point
of view (yes I tried it) but I really enjoyed it, very impressive.  I use
SQL all the time and it's great to learn something new.  It's definitely
true that RPG is the right solution here but I these kinds of things give an
idea of what is possible in other situations where it might be appropriate.
This is the best tip since I saw the bicycle icon in David Kahn's sig file!

I've also been taken aback by how the thread developed.  FWIW I'm a big fan
of OPNQRYF too, also since good old realease 8 of CPF.  Of course, when I
write the RPG program I will use the RPG cycle and level break indicators
but I don't want to start a big ruckus on the merits of that style :)

Thanks to all who responded.

Alan Novick
Pressman Toy Corporation
Enjoying the unsual biking weather in New Brunswick, NJ


----- Original Message -----
From: "Alexei Pytel" <pytel@us.ibm.com>
To: <midrange-l@midrange.com>
Sent: Tuesday, January 29, 2002 6:47 PM
Subject: RE: Can you do this in SQL



Just as an exersize - I can think of two ways of doing this in SQL:

1) in a single statement:

      update cus tu set rank =
      ( select count(*) from cus ts
         where tu.yr = ts.yr and tu.money <= ts.money )

which is not the best performer




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.