Skip to content

Instantly share code, notes, and snippets.

@wvpv
Last active December 31, 2018 16:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
select
x.bounceCategory
, x.sendid
from (
select
b.bounceCategory
, b.sendid
, row_number() over (partition by b.bounceCategory order by newid()) ranking
from _bounce b
) x
where x.ranking = 1
/* list all of the bounce categories and return */
/* a random sendid/jobid associated with each one */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment