3 or More Productions

I am trying to pull a list of constituents who have purchased 3 or more productions out of 9 specific productions. These need to be PAID orders, not comps of any kind. These constituents can have ANY combination grouping of 3 of the 9 productions. Any help is appreciated. This is cross posted in other forums as well.

For Example, out of the multiple possibilities of 9 productions, I would want to see a constituent record with purchases to production 1, 4, and 9; or 2, 3, and 7, etc.

Parents Reply
  • I'm pretty sure you'll need a manual query, something like this:

    select distinct

    vc.customer_no

    from

    V_CUSTOMER_WITH_PRIMARY_GROUP as vc with (nolock)

    inner join (

    select distinct

    th.customer_no

    from VS_TICKET_HISTORY as th with (nolock)

    where

    th.prod_no in (2101,4209,99,1093)

    group by

    th.customer_no

    having

    COUNT(distinct th.prod_no) > 2

    ) as p3 on p3.customer_no = vc.customer_no

Children
No Data