×
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.
Seems like a rank or dense_rank option is appropriate.
Select ...
[dense_]rank over( [partition by [field list] order by [field list] ) as Ranking
From ...
Order by ...
Limit 100;
-Matt
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Rob Berendt
Sent: Friday, February 1, 2019 2:54 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Select Top 100 in a Group By
For some reason this makes me thing of the genre of functions defined by CUBE, ROLLUP, etc.
But I've got a yen to get out of the office...
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Mike Wills
Sent: Friday, February 1, 2019 4:29 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Select Top 100 in a Group By
Hey everyone, it's been a while.
I am hoping for a shortcut on this, but I'm guessing there isn't. We have a request to pull a years worth of top usage data by due date.
So we have utility bills by customer and due date. We want to pull all customers that have the top usage by each billing cycle. I know how to pull that for all records, is there a shortcut way to pull the top x by a group by?
I am thinking like
SELECT CUSTOMER, DUE_DATE, TOP100(USAGE) FROM BILLHIST GROUP BY CUSTOMER, DUE_DATE
If there isn't, I guess I'll have to get creative. I'd build a program, but we only need it a couple times until May when this software will be done and we'll be on a .NET platform.
--
Mike Wills
https://urldefense.proofpoint.com/v2/url?u=http-3A__mikewills.me&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=TV68rjRmCiMsOOP99-rmdX8A0QBObpNHYrChr8awd78&s=XSVrFqHZJHC94bxzjS30_UIL7my_pIx7HE_51kd7u_w&e=
Ph: 507-933-0880
--
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,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=TV68rjRmCiMsOOP99-rmdX8A0QBObpNHYrChr8awd78&s=ihUsf1sbyZYyxBCupBqEufpUU3tTHqNWeiDLrSKjO24&e=
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=TV68rjRmCiMsOOP99-rmdX8A0QBObpNHYrChr8awd78&s=7zHCmIYmlPVDEMclJcYl4sT-DoR87Y8qqvy-O-MAZdo&e=.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=TV68rjRmCiMsOOP99-rmdX8A0QBObpNHYrChr8awd78&s=yKZM_O5znpC_sF_luNP7ZJAX0yKvW1jSlYciUbgkCzQ&e=
--
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,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=TV68rjRmCiMsOOP99-rmdX8A0QBObpNHYrChr8awd78&s=ihUsf1sbyZYyxBCupBqEufpUU3tTHqNWeiDLrSKjO24&e=
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=TV68rjRmCiMsOOP99-rmdX8A0QBObpNHYrChr8awd78&s=7zHCmIYmlPVDEMclJcYl4sT-DoR87Y8qqvy-O-MAZdo&e=.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=TV68rjRmCiMsOOP99-rmdX8A0QBObpNHYrChr8awd78&s=yKZM_O5znpC_sF_luNP7ZJAX0yKvW1jSlYciUbgkCzQ&e=
As an Amazon Associate we earn from qualifying purchases.