SQL query to list all members that have had a product manually added

Discussion in 'aMember Pro v.4' started by bennyuk1, May 2, 2013.

  1. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    200
    Hi

    I can create a query to output all users that have a product eg for the products with id = 22 and 50

    Select pr.title, Count(us.product_id)
    From am_user_status AS us
    Join am_product AS pr
    On pr.product_id = us.product_id
    where pr.product_id IN (22,50)
    Group By pr.title

    and I can create a report on all users details that have purchased particular products , eg id =22 and 50 again

    select * from am_user u, am_invoice_payment p, am_access a, am_product pr where u.user_id=p.user_id and p.invoice_payment_id=a.invoice_payment_id and pr.product_id=a.product_id and a.product_id IN (22 , 50)

    But can anyone help me output the names of users that have been manually assigned to products (eg 22 and 50), eg those who have not paid?

Share This Page