NTILE() Alternative for Buckets with a Fixed Number of Records

FLOOR((ROW_NUMBER()OVER(ORDER BY date)-1) /100) +1 AS Bucket

--

--

--

I am a certified Salesforce Marketing Cloud Consultant at Bower House Digital in Melbourne, Australia.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What are the Notable Loopholes in ERP Manufacturing Software?

Our Testnet is online

Salsify Spotlight: Keith Williams

1. LeetCode Two Sum

More About Passengers — Attribute Sneak Peak

Coding Journey

Lean That’s Better, Faster, Simpler

Using sentence transformer models from Sentence-Transformers and HuggingFace

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Charlie Fay

Charlie Fay

I am a certified Salesforce Marketing Cloud Consultant at Bower House Digital in Melbourne, Australia.

More from Medium

Create Database HR payroll using Ms SQL studio.

Create Database HR Payroll

SQL Server — Do my query use forced plans from Query Store?

SQL by steps #6 : WHERE (multi conditions)

SQL Server DROP and CREATE