× 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.



If on V5R4+, you can use ROW_NUBMER() OVER() syntax. The OVER() contains
your sorting option.

select row_number() over(order by department), a.* from prod_mod/deptmap a

yields

ROW_NUMBER DEPARTMENT DEPARTMENT PRODUCTION FINANCIAL
NUMBER TYPE DEPARTMENT GROUPING
1 129 M Y 4
2 130 M Y 6
3 131 M Y 5
4 162 M Y 1
5 171 M Y 5
6 172 M Y 4
7 176 M Y 5
8 178 M Y 5
9 179 M Y 4
10 182 M Y 2
11 183 M Y 3
12 184 M Y 2
13 217 A Y 1
14 218 A Y 1
15 222 M Y 4
16 228 A Y 5
17 229 A Y 4
18 230 A Y 6


HTH,
Loyd
On Thu, Sep 9, 2010 at 1:15 PM, Alan Shore <AlanShore@xxxxxxxx> wrote:


My SQL statement displays the results that I am looking, now I need to
display the "record number" of that line being displayed
for example
1 resulta
2 resultb
3 resultc
4 resultd
etc

However, my mind is just blank as to how to display the 1, 2, 3 etc

How can this be done?

As always, all replies much appreciated

Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
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:
Replies:

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.