× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Alan,

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:     <midrange-l@midrange.com>
                    om>                       cc:
                    Sent by:                  Fax to:
                    midrange-l-admin@mi       Subject:     Re: Can you do this 
in SQL
                    drange.com


                    01/30/2002 03:54 PM
                    Please respond to
                    midrange-l






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


_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.







As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

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