Which solution of Alexei's did you try?  The single SQL statement, or the
Cursor logic?

When I mentioned the part about SETLL before READ I forgot to mention cycle
versus the READ :-)

Rob Berendt
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin

                    "Alan Novick"
                    <mida@pressmantoy.c       To:     <>
                    om>                       cc:
                    Sent by:                  Fax to:
                    midrange-l-admin@mi       Subject:     Re: Can you do this 
in SQL

                    01/30/2002 03:54 PM
                    Please respond to


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
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" <>
To: <>
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 <= )

which is not the best performer

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email:
To subscribe, unsubscribe, or change list options,
or email:
Before posting, please take a moment to review the archives

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2022 by 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.