Lets say I have 5 records that group together to 1:
the MIN() query would return:
I want to see:
It may be easier to say, I want to see the first record in a group...
On 2/6/2013 3:36 PM, Matt Olson wrote:
So why didn't " select usrinusr, usrinjob, usrinnbr, min(usrinlvl),min(usrinpgm), min(usrintstmp) from mgpll/usrinpf1 group by usrinusr,
usrinjob, usrinnbr order by usrinnbr"
for rest of fields.
Work for you?
From: Gqcy [mailto:gmufasa01@xxxxxxxxx]
Sent: Wednesday, February 06, 2013 2:43 PM
Subject: sql - group by clause, aggregate returning first record values
fields (jobname, user, jobnumber), I want to return the "first values
I have a file with 6 fields, I want to aggregate by the first three
found" for the rest of the fields in the file.
I can get min() to kinda work, but that is field dependent.mgpll/usrinpf1 group by usrinusr, usrinjob, usrinnbr order by usrinnbr
select usrinusr, usrinjob, usrinnbr, usrinlvl, usrinpgm, usrintstmp from
record by usrinusr, usrinjob, usrinnbr...
I want to return the values in the first record returned for the group
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,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
This mailing list archive is Copyright 1997-2013 by MIDRANGE dot 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 here. If you have questions about this, please contact