Thanks Joe. I'm reading up on CTE's a bunch

I'll throw a monkey wrench in here.

Status 60 is the final status. I only want the status 60 to use the date
range selection. All others statuses have to be displayed because they are
still moving. Is that possible?

Thanks again, Art

On Thu, Jan 2, 2020 at 4:01 PM Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:

And one last time, with the missing space restored. Ugh.

Doing it again with no bold or underline, which can get lost in

On 1/2/2020 2:10 PM, Joe Pluta wrote:
with maxstat as (
select gs1, max(status) status from table
where ts between ts1 and ts2
group by gs1)
select status, count(*) from maxstat
group by status order by status

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

Please contact support@xxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

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.