HELP! Left, Right, Inner Join

J

Jeff Uchtman

I have a table that upon verify is inserting a unique Cir_ID in to one of
four columns, PetACirc, PetBCirc, PetCCirc, PetDCirc. I am attempting to
count the total number of columns each Cir_ID has filled and left join the
name for association. I have part of it but can't get over the hump to get
the count from the other 3 columns. Her is what I have:

Select p.Cir_ID, p.First_Name, p.Last_Name,
Count(c.PetACirc)AS [ACount],
Count(c.PetBCirc)AS [BCount],
Count(c.PetCCirc)AS [CCount],
Count(c.PetDCirc)AS [DCount]
From CirID
AS p Left JOIN Verified as c on p.Cir_ID = c.PetACirc
Group by p.Cir_ID, p.First_Name, p.Last_Name
Order by p.Cir_ID

As you can see it will give me the count on the PetACirc column in the line:

AS p Left JOIN Verified as c on p.Cir_ID = c.PetACirc

but I would also like PetBCirc, PetCCirc, and PetDCirc counts. Any help on
inner and or left join with a distinct value?

Thanks
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top