Yes, there have been several threads that discuss methods for this. Search the archives for SQL Scratchpad....
Eric
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Jeff Young
Sent: Tuesday, April 22, 2008 5:14 PM
To: midrange-l@xxxxxxxxxxxx
Subject: SQL Question
Is it possible in an interactive SELECT statement to have a incremental counter value?
I would like to be able to do something like this:
Select company,location,account,description, (counter + 1) from somefile where company = 101.
The idea is that I would get a result with counter starting at 1 and incrementing to the last record selected.
TIA,
Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3
As an Amazon Associate we earn from qualifying purchases.
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.